Fix oversized D81 track initialization - #848
Merged
Merged
Conversation
barryw
force-pushed
the
fix/d81-track-bounds
branch
2 times, most recently
from
September 4, 2026 19:50
ad6a75c to
932130c
Compare
D81 track counts are derived from file size. Values above the fixed 84-track arrays corrupt adjacent memory during layout initialization. Clamp at the shared boundary and cover 80-, 81-, 84-, and oversized layouts with a sanitizer host test. Closes GideonZ#846
Generate 80-, 81-, and 85-track fixtures, then verify physical track 81 through the emulated 1581 on real hardware.\n\nRefs GideonZ#846
barryw
force-pushed
the
fix/d81-track-bounds
branch
from
September 4, 2026 19:54
932130c to
ed38f9d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
D81 track counts come from image size. An image containing more than 84 tracks made
MfmDisk::init()index past its fixedside0andside1arrays, corrupting adjacent memory.The bound is enforced once in
MfmDisk::init(), covering every caller.Verification
make d81_tracks_testpasses under macOS Clang and Linux GCCThe E2E fixtures are generated during the test; no Wheels image is distributed.
Closes #846