mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 00:38:35 +00:00
synaptics-prometheus: Add a sanity check to fix a fuzzing failure
Fixes https://oss-fuzz.com/testcase-detail/6232454836387840
This commit is contained in:
parent
3553336eff
commit
2b81290829
@ -104,6 +104,17 @@ fu_synaprom_firmware_parse(FuFirmware *firmware,
|
||||
tag);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* sanity check */
|
||||
img = fu_firmware_get_image_by_idx(firmware, tag, NULL);
|
||||
if (img != NULL) {
|
||||
g_set_error(error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_INVALID_DATA,
|
||||
"tag 0x%04x already present in image",
|
||||
tag);
|
||||
return FALSE;
|
||||
}
|
||||
hdrsz = GUINT32_FROM_LE(header.bufsz);
|
||||
if (hdrsz == 0) {
|
||||
g_set_error(error,
|
||||
|
Loading…
Reference in New Issue
Block a user