ihex: Do not allow zero-sized data sections

This commit is contained in:
Richard Hughes 2021-03-21 18:35:44 +00:00
parent 69016bda04
commit c8423fd685

View File

@ -237,6 +237,13 @@ fu_ihex_firmware_parse (FuFirmware *firmware,
"cannot process data after EOF");
return FALSE;
}
if (rcd->data->len == 0) {
g_set_error_literal (error,
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,
"cannot parse invalid data");
return FALSE;
}
/* base address for element */
if (img_addr == G_MAXUINT32)