Harden reflection verifier against malformed schemas#9169
Open
M0nd0R wants to merge 1 commit into
Open
Conversation
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
Validation
g++ -std=c++11 -Iinclude /tmp/flatbuffers_reflection_union_poc.cpp src/reflection.cpp src/util.cpp -o /tmp/flatbuffers_reflection_union_poc && /tmp/flatbuffers_reflection_union_pocreturnedVerify returned 0after the fix; before the fix it crashed withSIGSEGVatflatbuffers::Vector<unsigned char>::size()g++ -std=c++11 -Iinclude /tmp/flatbuffers_reflection_struct_size_poc.cpp src/reflection.cpp src/util.cpp -o /tmp/flatbuffers_reflection_struct_size_poc && /tmp/flatbuffers_reflection_struct_size_pocreturnedVerify returned 0after the fix; before the fix it crashed withSIGFPEinVerifierTemplate::VerifyVectorOrString()cmake -S . -B /tmp/flatbuffers-build -DCMAKE_BUILD_TYPE=Debug -DFLATBUFFERS_BUILD_TESTS=ON -DFLATBUFFERS_BUILD_FLATC=ON -DFLATBUFFERS_BUILD_FLATLIB=ON -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_BUILD_GRPCTEST=OFFcmake --build /tmp/flatbuffers-build --target flattests -j2/tmp/flatbuffers-build/flattestsctest --test-dir /tmp/flatbuffers-build --output-on-failure -R flattestsgit diff --checkclang-formatwas not available in this environment, so I validated formatting through compile/test plusgit diff --check.