summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-12-29 18:00:29 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-12-29 18:00:29 +0100
commit46ae2717d2b14080f41fe2ffe7c14b071e67507d (patch)
tree39a5a9c99909de8eb90b794eee61f73c8c9a2e22
parentccb509e4756f5d9d20ce63b1a264a205e7e25b9c (diff)
downloadlibr-46ae2717d2b14080f41fe2ffe7c14b071e67507d.tar.gz
libr-46ae2717d2b14080f41fe2ffe7c14b071e67507d.zip
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>
-rw-r--r--src/libr-icons.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libr-icons.c b/src/libr-icons.c
index 18dc536..acceac8 100644
--- a/src/libr-icons.c
+++ b/src/libr-icons.c
@@ -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 */