mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-15 02:54:47 +00:00
srec: Detect overflow to avoid adding ~4GB of 0xFF padding
Fixes https://oss-fuzz.com/testcase-detail/5468114109202432
This commit is contained in:
parent
752c8de149
commit
1c0ed3ab1d
@ -379,6 +379,14 @@ fu_srec_firmware_parse (FuFirmware *firmware,
|
||||
if (img_address == 0x0)
|
||||
img_address = rcd->addr;
|
||||
addr32_last = rcd->addr + rcd->buf->len;
|
||||
if (addr32_last < rcd->addr) {
|
||||
g_set_error (error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INVALID_FILE,
|
||||
"overflow from address 0x%x at line %u",
|
||||
(guint) rcd->addr, rcd->ln);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
data_cnt++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user