mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
mkimg: Don't ignore invalid partition offsets
When handling PART_KIND_FILE, the "error" variable is set to reflect
any errors in parsing the specified offset; but that value is then
overwritten by the return value of image_copyin.
Error out immediately instead. Note that it is not necessary to change
the code in PART_KIND_SIZE which parses the size, since in that case we
do not overwrite the value in "error".
Fixes: 8f3c71c85e ("mkimg: Add support for offset if the source is an image")
MFC after: 1 week
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D60422
This commit is contained in:
1 parent
38407c46de
commit
e7f84fe6cf
1 file changed
+1
-1
@@ -504,7 +504,7 @@ mkimg(void)
|
||||
else
|
||||
offset++;
|
||||
if (expand_number(offset, &byteoffset) == -1)
|
||||
error = errno;
|
||||
err(EX_IOERR, "partition %d", part->index + 1);
|
||||
}
|
||||
|
||||
/* Work out exactly where the partition starts. */
|
||||
|
||||
Reference in new issue
Block a user