Skip to content
New issue

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

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

Already on GitHub? # to your account

fix parsing of JSON null values #97

Merged
merged 3 commits into from
Jan 25, 2022
Merged

fix parsing of JSON null values #97

merged 3 commits into from
Jan 25, 2022

Conversation

satta
Copy link
Member

@satta satta commented Jan 24, 2022

This PR fixes a bug in the way FEVER currently handles incoming JSON fields that are null (not the string "null" but a JSON null value): These cause a parse error, as they are not handled correctly by the low-level jsonparser.Parse*() function used in the main JSON parser code. We need to explicitly check for those and skip them.

Note (for peace of mind) that this issue is not relevant for incoming Suricata EVE-JSON (as this will never set null fields) but only when handling EVE-JSON from other sources.

@satta satta requested a review from 0mbi January 24, 2022 17:56
Copy link
Contributor

@0mbi 0mbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to be pretty trivial, but do you mind to add add an unit test for this behaviour?

@satta
Copy link
Member Author

satta commented Jan 25, 2022

It appears to be pretty trivial, but do you mind to add add an unit test for this behaviour?

Done!

@satta satta merged commit a4feb0f into DCSO:master Jan 25, 2022
@satta satta deleted the nullfix branch January 27, 2022 18:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants