Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its behaviour conflicts with other merged PRs (tests fail together). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested PR #324 at head
Behavior covered: Checks TLS callback arrays accept terminated, empty and null forms while rejecting unterminated and over-limit arrays. |
The synthetic-image tests expect Merged with plain AI use: Claude Code, Claude Opus 5.5. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 8fc3a1b on Windows 11, RTX 5070, MSVC: cargo test -p victory-pe 13 passed, including the terminated, unterminated and over-limit TLS tests. cargo clippy -p victory-pe --all-targets is clean. victory inspect on a local title executable parses as before (same output and no error), so the stricter check doesn't reject a real image.
- Requiring the null terminator inside the array's bytes matches what the Windows loader relies on: it walks until a null, so an unterminated array means it would read past the section. Refusing more than
MAX_TLS_CALLBACKS(1024), instead of silently truncating, avoids running a partial set. - Nit:
cargo fmt -p victory-pe --checkreports diffs in the new tests (the hand-wrappedcopy_from_slice(andImageInfo::parse(calls). Runningcargo fmton the file would tidy them.
AI-assisted (Claude Code).
…ck arrays Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges Marvisak#188 Marvisak#213 Marvisak#214 Marvisak#219 Marvisak#221 Marvisak#311 Marvisak#324 Marvisak#363 Marvisak#406 Marvisak#454 Marvisak#529 Marvisak#560 Marvisak#708 Marvisak#937 Marvisak#941 Marvisak#963 Marvisak#1111 Marvisak#1159 Marvisak#1304 Marvisak#1306 onto main (ffe310e), each head unchanged, no conflicts. One change of mine: the long-format import descriptor code Marvisak#963 adds nests `if size == 0` in an `if let`, which clippy::collapsible_if rejects under -D warnings; it is now one `if let ... && size == 0` (clippy --fix, no change of behaviour). cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (388 passed, 7 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Follow-up at c37793a: fixed a reproduced synthetic compatibility defect involving TLS terminators in zero-filled virtual memory. All 9 focused TLS tests and portable PE regressions passed on Apple M5. Formatting and asset policy passed. Platform-specific own-PE tests were excluded on macOS; the IAT test failure was independently reproduced on the original commit. Whether this fixes the reported title-loading regression remains unverified. Independent retesting appreciated. AI-assisted with ChatGPT. |
|
Automated triage for the maintainers. Proposed close: adds load failures for cases that do not occur. This makes CI: This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the Generated by Claude Code |
Problem
parse_tls()silently accepts callback arrays that reach the end of the available section data without a null terminator, or contain more thanMAX_TLS_CALLBACKSentries.In both cases,
ImageInfo::parse()can return a partial callback list without reporting an error.Proposed fix
Report an explicit malformed-image error for unterminated callback arrays.
Reject arrays exceeding the existing 1,024-callback limit instead of silently truncating them.
Preserve valid empty arrays, null callback pointers and arrays containing exactly 1,024 callbacks followed by a terminator.
One compatibility detail for review: whether callback arrays terminated by implicit zero-filled virtual memory should also be accepted.
Verification
Tested on Apple M5, macOS arm64, Rust 1.98.1, against main
Check | Before | After -- | -- | -- Synthetic TLS tests | 4 passed, 2 failed | 6 passed, 0 failed Portable PE unit tests | — | 9 passed, 0 failed Clippy | — | Clean Asset policy | — | 151 files OKd2a4bae.The four existing Windows-specific own-binary tests were excluded from the portable PE test run.
All new fixtures are generated in memory. No game data was used.
AI-assisted implementation and test preparation (ChatGPT). Commands executed and results verified locally.