mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #890] OLD-7928: analyze_4240_full: guard trailing high-bit words, bound zlib inflation, validate limit, and write JSON atomically #928
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#928
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/890
Author: @narekshaghoyandev
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:ubiq-analyze-4240-full-bounds-and-zlib-cap📝 Commits (1)
fdcdb60analyze_4240_full: guard trailing high-bit words, bound zlib inflation, validate limit, and write JSON atomically📊 Changes
2 files changed (+130 additions, -26 deletions)
View changed files
📝
tests/test_analyze_4240_full.py(+55 -0)📝
tools/analyze_4240_full.py(+75 -26)📄 Description
Reopening my original upstream PR #7928 cleanly rebased onto
main:process_archive): Guardspos + 12 <= len(stream_data)before readingtriangles/refsso negative float vertex data in the final 4..11 bytes of a stream cannot crash the archive scan withValueError, and only countsstats["groups"]when the group fits in the stream._inflate_bounded,iter_archive_streams): Replaces unboundedd.decompress(block)with chunked decompression capped atmax_inflate(64 MiBdefault) to prevent OOM on zlib bombs.--limitvalidation (process_archive): Rejectslimit < 1andbooldirectly inprocess_archive.write_json,main): Publishes--jsonviatempfile.mkstemp+file_mode.published_mode+replace_retry.replacewithallow_nan=False, trailing LF, and read-only-safe temp cleanup.Verification
python3 -I tests/test_analyze_4240_full.py -v: 19/19 pass (all 3 new tests fail/error againstmain).python3 -I scripts/check_no_game_data.py tools/analyze_4240_full.py tests/test_analyze_4240_full.py: clean.python3 -m compileall -q tools/analyze_4240_full.py tests/test_analyze_4240_full.py: clean.Claimed in the coordination issue as: OLD-7928 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135225878)
AI-assisted: yes (Gemini)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.