Scripts: reject trailing BCPack table bytes under optimization #2723
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2733"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:10:23Z.
Python's optimized mode strips the assertion that checks whether the BCPack table parser consumed all input. A VIctory table with extra bytes can then overwrite the generated Rust file as if it were valid.
What is in it
Tested
b49be183, 1 passed and 1 failed. The optimized malformed input unexpectedly exited 0.git diff --checkpassed.Regression run
Script and test changes only.
Not tested
AI use
OpenAI Codex (GPT-6) reproduced the issue, wrote the patch and tests, and ran the checks above.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T09:15:20Z.
Closing this draft in favor of #1440. Independent review found that #1440 already replaces the trailing-data assertion with explicit validation, checks the exact input size before output, and adds tests in the same script test file. Our optimized-Python case is covered by that explicit validation and does not warrant a competing PR. Thanks to the #1440 author for the broader fix. AI-assisted duplicate check (OpenAI Codex, GPT-6).
Pull request closed