Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON_Validate() return success on Illegal JSON #165

Closed
vasilchenkosv opened this issue Jun 27, 2024 · 2 comments
Closed

JSON_Validate() return success on Illegal JSON #165

vasilchenkosv opened this issue Jun 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@vasilchenkosv
Copy link

vasilchenkosv commented Jun 27, 2024

JSON_Validate() skip wrong JSON document. In example result == JSONSuccess, but must be JSONIllegalDocument.

const char* json = "{\"k1\":\"v1\",{\"k2\":\"v2\"}}";
JSONStatus_t result = JSON_Validate(json, strlen(json));

@kstribrnAmzn kstribrnAmzn added the bug Something isn't working label Jun 27, 2024
@rawalexe
Copy link
Member

Hello @vasilchenkosv,
Thank you for raising the bug, we will look into the problem and possible solutions internally, meanwhile if you have a quick solution to the problem we also accept PR from the community.

Thank you,

Best Regards,
AR

aggarg added a commit to aggarg/coreJSON that referenced this issue Jul 1, 2024
The following invalid JSON document would be classified as valid JSON
without this change:
```
{
    "key1":"val1",
    {
        "key2":"val2"
    }
}
```

The issue was reported here - FreeRTOS#165.

Signed-off-by: Gaurav Aggarwal <[email protected]>
AniruddhaKanhere pushed a commit that referenced this issue Jul 1, 2024
* Correctly detect missing key in a key-value pair

The following invalid JSON document would be classified as valid JSON
without this change:
```
{
    "key1":"val1",
    {
        "key2":"val2"
    }
}
```

The issue was reported here - #165.

Signed-off-by: Gaurav Aggarwal <[email protected]>

* Update complexity threshold to 12

Signed-off-by: Gaurav Aggarwal <[email protected]>

* Fix memory estimates and formatting checks

Signed-off-by: Gaurav Aggarwal <[email protected]>

* Fix CBMC proofs

Signed-off-by: Gaurav Aggarwal <[email protected]>

---------

Signed-off-by: Gaurav Aggarwal <[email protected]>
@AniruddhaKanhere
Copy link
Member

@vasilchenkosv thank you for bringing this to our attention. As the PR #167 is merged, I shall be closing this issue.
Feel free to reopen this thread or open a new one if you feel that your issue has not been resolved. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants