Skip to content

Add bounds check for root offset in AddFlatBuffer#8982

Open
rootvector2 wants to merge 1 commit intogoogle:masterfrom
rootvector2:addflatbuffer-bounds-check
Open

Add bounds check for root offset in AddFlatBuffer#8982
rootvector2 wants to merge 1 commit intogoogle:masterfrom
rootvector2:addflatbuffer-bounds-check

Conversation

@rootvector2
Copy link

AddFlatBuffer reads the root offset from the input buffer and uses it
for pointer arithmetic without validating that it lies within the buffer bounds.

This change adds a minimal bounds check before using the offset to avoid
undefined behavior when malformed data is passed.

No behavior change for valid inputs.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant