Skip to content

fix(fdt_mut): use correct slice length on FdtMut=>Fdt conversion - #100

Merged
m4tx merged 1 commit into
mainfrom
into-slice
Oct 22, 2026
Merged

m4tx merged 1 commit into
mainfrom
into-slice

Conversation

@m4tx

@m4tx m4tx commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

fix(fdt_mut): use correct slice length on FdtMut=>Fdt conversion

Fdt assumes that data.len() == totalsize. If the slice capacity is
bigger than the FDT blob itself, this breaks the assumption. This commit
ensures the slice passed to Fdt is exactly totalsize bytes long.

This mainly affects Fdt::data() which could return garbage data after
the end of the FDT blob.

`Fdt` assumes that `data.len() == totalsize`. If the slice capacity is
bigger than the FDT blob itself, this breaks the assumption. This commit
ensures the slice passed to `Fdt` is exactly `totalsize` bytes long.

This mainly affects `Fdt::data()` which could return garbage data after
the end of the FDT blob.
@m4tx
m4tx requested a review from qwandor October 22, 2026 12:31
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.17%. Comparing base (40eb29c) to head (4d9d213).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #100   +/-   ##
=======================================
  Coverage   93.16%   93.17%           
=======================================
  Files          26       26           
  Lines        3336     3339    +3     
=======================================
+ Hits         3108     3111    +3     
  Misses        228      228           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m4tx
m4tx merged commit 4a7faf2 into main Oct 22, 2026
35 checks passed
@m4tx
m4tx deleted the into-slice branch October 22, 2026 12:40
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.

2 participants