util/nvmutil: safer cast in nvm_word

cast buf[x] directly.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-09 16:41:40 +00:00
parent 2d4567238a
commit afebfe7389
+2 -1
View File
@@ -1146,7 +1146,8 @@ nvm_word(size_t pos16, size_t p)
check_nvm_bound(pos16, p);
pos = (pos16 << 1) + (p * GBE_PART_SIZE);
return (uint16_t)buf[pos] | (uint16_t)(buf[pos + 1] << 8);
return (uint16_t)buf[pos] |
((uint16_t)buf[pos + 1] << 8);
}
static void