Commit fe7e77f
committed
u-boot: v2026.04: helios64: bound otp.part_num debug print
show_otp_data() printed otp.part_num (a fixed 16-byte field, not a
C string) with plain %s. If OTP content lacks a NUL terminator, printf
would over-read into the adjacent packed fields. Use %.*s with
strnlen(..., sizeof(otp.part_num)) so the output is bounded by both
the actual content length and the field size.
Only reachable in DEBUG builds, but the UB is real.
Suggested-by: coderabbitai[bot]1 parent 071894b commit fe7e77f
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
0 commit comments