From afebfe73898b1795f53ff819fdd793a4cb4be73a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 9 Mar 2026 16:41:40 +0000 Subject: util/nvmutil: safer cast in nvm_word cast buf[x] directly. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 87ec66cf..00683062 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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 -- cgit v1.2.1