Repository navigation
Conversation
When ucl_parse_macro_value() fails, e.g. because the input ends right after a macro's arguments such as ".priority(a=1)", the parsed macro arguments object was leaked. Unref it on that error path. Also add a regression test that places each input at the end of a mapped page followed by a PROT_NONE guard page, covering both the out-of-bounds read fixed in 5f98085 and the leak above (when run under LeakSanitizer). Found by OSS-Fuzz (rtpproxy fuzz_config_file).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While tracking an OSS-Fuzz crash in rtpproxy's
fuzz_config_file(an overread inucl_parse_macro_valueat EOF, already fixed here by 5f98085), I found that the same path still leaks the parsed macro arguments:.priority(a=1)followed by EOF, whitespace or a comment makesucl_parse_macro_value()fail and themacro_argsobject is never released.This PR:
macro_argswhenucl_parse_macro_value()fails;tests/test_macro_eof.cwhich places each input right before a PROT_NONE guard page, so it covers the OOB read without sanitizers and the leak under LeakSanitizer.Verified with an ASan build: the new test fails on current master (leak) and passes with the fix; no other test changes (
test_schemaalready reports leaks under ASan on master, unrelated).