mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-15 15:03:48 +00:00
libdfu: Fix a crash if elf32_newehdr() fails
This commit is contained in:
parent
061ad8c5e8
commit
c3c50fba4c
@ -386,7 +386,10 @@ dfu_firmware_to_elf (DfuFirmware *firmware, GError **error)
|
|||||||
/* add executable header */
|
/* add executable header */
|
||||||
ehdr = elf32_newehdr (e);
|
ehdr = elf32_newehdr (e);
|
||||||
if (ehdr == NULL) {
|
if (ehdr == NULL) {
|
||||||
g_warning ("failed to create executable header: %s",
|
g_set_error (error,
|
||||||
|
DFU_ERROR,
|
||||||
|
DFU_ERROR_INTERNAL,
|
||||||
|
"failed to create executable header: %s",
|
||||||
elf_errmsg (-1));
|
elf_errmsg (-1));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user