util/nvmutil: fix possible overflow: gbe_x_offset

preventative fix, since the values are currently
quite tiny. this new check is the same, but goes
the other way to eliminate overflow.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-10 14:15:34 +00:00
parent 883860d687
commit c953228bb0
+1 -1
View File
@@ -1318,7 +1318,7 @@ gbe_x_offset(size_t p, const char *f_op, const char *d_type,
off = ((off_t)p) * (off_t)nsize;
if (off + GBE_PART_SIZE > ncmp)
if (off > ncmp - GBE_PART_SIZE)
err(errno, "%s: GbE %s %s out of bounds",
fname, d_type, f_op);