mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-03 05:50:20 +00:00
synaprom: Do not add zero sized images
This prevents a DoS when parsing corrupt firmware.
This commit is contained in:
parent
976b6afe63
commit
0eb8b6a2a8
@ -100,6 +100,14 @@ fu_synaprom_firmware_parse (FuFirmware *firmware,
|
||||
return FALSE;
|
||||
}
|
||||
hdrsz = GUINT32_FROM_LE(header.bufsz);
|
||||
if (hdrsz == 0) {
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_INVALID_DATA,
|
||||
"empty header for tag 0x%04x",
|
||||
tag);
|
||||
return FALSE;
|
||||
}
|
||||
offset += sizeof(header) + hdrsz;
|
||||
if (offset > bufsz) {
|
||||
g_set_error (error,
|
||||
|
Loading…
Reference in New Issue
Block a user