sgd5_effects: enforce database bounds in program_groups, guard program_identity EOF, validate layout (SGD5-EFFECTS-BOUNDARY-VALIDATION) #1589
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1589"
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 ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T05:19:30Z.
Item:
SGD5-EFFECTS-BOUNDARY-VALIDATION(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/sgd5_effects.py).Summary
limitbefore every read inprogram_groups()(group count headers, per-group count upper bound against the 176-byte minimum program record size, program label/tag/size framing, and effect-count header inread_database()) so malformed records in database 1 never read pastlimitinto following archive data.program_identity()against negative offsets, EOF, short length bytes (< 2), and truncated windows so it raisesValueErrorinstead of crashing withIndexErroronstream.read(1)[0]orwindow[pos - 1].layoutordering (0 <= database,first_group >= database + 4,end > first_group) up front inread_database(), and passallow_nan=Falsetojson.dumps()inmain().Verification
python3 -W error -I tests/test_sgd5_effects.py -v: 12 passed, 1 skipped (retail package test withoutLEONIDA_GAME_DIR).python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/sgd5_effects.py tests/test_sgd5_effects.py: passed.python3 -m compileall -q tools/sgd5_effects.py tests/test_sgd5_effects.py: passed.tests/test_sgd5_effects.pyagainst unpatchedmain:tools/sgd5_effects.py):failures=7, errors=2across all new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python binary metadata parser; synthetic SGD5 blobs only, no game data)
Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T05:19:41Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:26:47Z.
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main
3ca0707: no new failure, Linux / Python 3.13.AI-assisted (Claude Code, Claude Opus 5.5)