fix: harden rpscan argument parsing - #4
Open
sit-d wants to merge 1 commit into
Open
Conversation
Author
|
Fresh post-PR verification: ad-hoc verifier /tmp/hermes-verify-tools-rpscan-post-33kf3wdu.c compiled with gcc -Wall -Wextra -Werror, exercised parse_u32 boundary/invalid cases (0, 42, 0xffffffff, 4294967295, blank/signed/trailing-junk/overflow inputs), checked rpscan.c contains the va_copy/va_end and UINT32_MAX/sign guards, and ran git diff --check HEAD~1..HEAD. It exited 0; verifier source and binary were removed. |
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.
Summary
--max-depthvalues before callingwcstoullUINT32_MAXinstead of silently truncating them into theuint32_tdepth limitva_listVerification
gcc -Wall -Wextra -Werror /tmp/hermes-verify-tools-rpscan-*.c -o /tmp/hermes-verify-tools-rpscan-*on a dependency-free extraction ofparse_u320,42,0xffffffff,4294967295) and invalid cases (blank, signed, trailing junk,4294967296,0x100000000)git diff --checkThe temporary verifier exited 0 and was removed.
Notes / limitations
cl/clang-clbuild was not run from the Linux cron environment because Windows SDK headers/libraries are unavailable here.rpscan.c.