mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: calculate off AFTER part validation
because we check the part first, so we need to know it's valid before proceeding. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -807,12 +807,14 @@ static off_t
|
||||
gbe_x_offset(size_t p, const char *f_op, const char *d_type,
|
||||
off_t nsize, off_t ncmp)
|
||||
{
|
||||
off_t off = (off_t)p * nsize;
|
||||
off_t off;
|
||||
|
||||
if (p > 1)
|
||||
err(ECANCELED, "GbE %s %s invalid partnum: %s",
|
||||
d_type, f_op, fname);
|
||||
|
||||
off = (off_t)p * nsize;
|
||||
|
||||
if (off + GBE_PART_SIZE > ncmp)
|
||||
err(ECANCELED, "GbE %s %s out of bounds: %s",
|
||||
d_type, f_op, fname);
|
||||
|
||||
Reference in New Issue
Block a user