mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user