Repository navigation
parser lyb BUGFIX reject a child hash without a schema parent - #2662
Open
Mohil-Ahuja wants to merge 1 commit into
Open
Mohil-Ahuja wants to merge 1 commit into
Mohil-Ahuja wants to merge 1 commit into
Conversation
A child node read at the top level, or as a child of an opaque node, has neither a schema parent nor a module. Its hash then never matches, and the error message dereferenced the NULL schema parent, which an assert hid only in debug builds. Fail with an error before the lookup instead. Also reject an empty module name, which was only asserted.
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.
A child node read at the top level, or as a child of an opaque node, has neither a schema parent nor a module.
lyb_parse_schema_hash()then finds no match, and the error message dereferences the NULL schema parent. Anassert()covers this in debug builds, but a release build crashes on the 4 bytes02 fb 02 fb:The fix fails with "Invalid LYB data, schema node hash without a schema parent." before the lookup. It also turns the
assert((*name)[0])inlyb_parse_module()into an error, so12 00 03(an empty module name) no longer aborts a debug build.Both inputs are in a new
test_invalid_hash_parentintest_lyb.c. I found them by fuzzinglyd_parse_lybon devel.