Fix setting UUID of ELF file icon.

The GUID was checked, converted to a UUID structure, but was not written
to the icon. This could cause each call to libr_icon_setuuid to store a
different UUID, making reproducible builds impossible.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 46ae2717d2)
r14.0.x
Slávek Banko 4 years ago
parent d47907f7a3
commit 9444f009b0
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -542,6 +542,7 @@ EXPORT_FN int libr_icon_setuuid(libr_file *handle, char *guid)
memcpy(&(icons.buffer[OFFSET_ENTRIES]), &entries, sizeof(uint32_t));
}
/* Set the GUID and write the resource */
memcpy(&(icons.buffer[OFFSET_GUID]), &id, sizeof(UUID));
if(!libr_write(handle, ICON_SECTION, icons.buffer, icons.size, LIBR_UNCOMPRESSED, LIBR_OVERWRITE))
{
/* failed to write icon resource */

Loading…
Cancel
Save