Commit 611fff6
committed
u-boot: v2026.04: helios64: bounds-check variant in show_otp_data
show_otp_data() directly indexed var_str[otp.variant] without validation.
If the OTP blob is corrupted (e.g. variant byte out of 0..BOARD_VARIANT_MAX-1
range), this read is out of bounds.
Mirror the check already used in get_variant(): fall back to var_str[0]
("Invalid variant") when otp.variant is out of range.
This is debug-only (wrapped in #ifdef DEBUG) and never reached in
production builds, but keeps behavior consistent with get_variant() and
avoids a latent OOB read if DEBUG is enabled.
Addresses a CodeRabbit review comment on PR armbian#9675.1 parent 84e215d commit 611fff6
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
0 commit comments