Conversation
|
@codex hows about you review your own work how about that let's see huh what about it |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d0d134236
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut scratch = vec![0u8; aligned_len]; | ||
| let mut filled = 0usize; | ||
| while filled < scratch.len() { | ||
| let lba = (aligned_start as usize + filled) / self.block_size; |
There was a problem hiding this comment.
Keep LBA math in u64 when deriving source offsets
SourceByteReader::read_exact_at computes lba via (aligned_start as usize + filled) / self.block_size, which truncates aligned_start on 32-bit targets (notably wasm32). For GPT images whose reads cross the 4GiB boundary, this causes reads from the wrong source blocks while still returning success, so partition data becomes silently corrupted. Perform this arithmetic in u64 and only downcast with checked conversions where required.
Useful? React with 👍 / 👎.
| let partition_entries_lba = read_u64_le(raw, 72)?; | ||
| let partition_entry_count = read_u32_le(raw, 80)?; | ||
| let partition_entry_size = read_u32_le(raw, 84)?; |
There was a problem hiding this comment.
Validate GPT header and entry-array CRCs
The GPT parser reads structural fields but never validates the header CRC32 (offset 16) or partition-entry-array CRC32 (offset 88), so corrupted or stale GPT metadata can still be accepted and used to resolve a partition. In a range-backed reader this can select the wrong partition bytes without any error, so integrity checks should happen before trusting partition_entries_lba, partition_entry_count, and related fields.
Useful? React with 👍 / 👎.
Signed-off-by: Sam Day <me@samcday.com> Assisted-by: opencode:gpt-5.3-codex
Signed-off-by: Sam Day <me@samcday.com> Assisted-by: opencode:gpt-5.3-codex
No description provided.