Skip to content

Fix $STANDARD_INFORMATION parsing for 48-byte values#146

Merged
omerbenamram merged 2 commits intomasterfrom
bugfix/stdinfo-sized-parse
Jan 1, 2026
Merged

Fix $STANDARD_INFORMATION parsing for 48-byte values#146
omerbenamram merged 2 commits intomasterfrom
bugfix/stdinfo-sized-parse

Conversation

@omerbenamram
Copy link
Copy Markdown
Owner

@omerbenamram omerbenamram commented Jan 1, 2026

Summary

  • Fix $STANDARD_INFORMATION parsing to respect the resident value length (48 vs 72 bytes).
  • Avoid reading past 48-byte values into the next attribute record header (previously produced garbage owner_id/security_id/quota/usn).
  • Add unit + integration regression tests (covers samples/MFT entry 5 with a 48-byte $STANDARD_INFORMATION).

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test -p mft --all-features

Note

Ensures $STANDARD_INFORMATION is parsed according to its resident value length, avoiding reads into subsequent attribute headers.

  • Read exact resident.data_size for StandardInformation and parse via new StandardInfoAttr::from_slice (supports 48- and 72-byte layouts)
  • Return zeroed extended fields when value is 48 bytes; reject intermediate sizes as invalid
  • Add unit tests for 48/72-byte parsing and an integration test against samples/MFT entry 5 to prevent leakage into next attribute header

Written by Cursor Bugbot for commit 8b1668a. This will update automatically on new commits. Configure here.

Parse $STANDARD_INFORMATION based on the resident value length (48 vs 72 bytes)
so we don't read past the value into the next attribute header.

Add unit and integration regression tests.
@omerbenamram omerbenamram changed the title Fix parsing for 48-byte values Fix $STANDARD_INFORMATION parsing for 48-byte values Jan 1, 2026
@omerbenamram omerbenamram merged commit ea28412 into master Jan 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant