From: Michael Tremer Date: Thu, 9 Jan 2025 16:33:31 +0000 (+0000) Subject: ELF: Actually return NULL if there is no Build ID X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c29683c5fdfdf5905f36a60403c402daeae9b891;p=people%2Fric9%2Fpakfire.git ELF: Actually return NULL if there is no Build ID Before, we allocated an empty string which is unnecessary and confused me further down the line. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/elf.c b/src/pakfire/elf.c index 68d6a8c43..caf508a33 100644 --- a/src/pakfire/elf.c +++ b/src/pakfire/elf.c @@ -263,6 +263,10 @@ const char* pakfire_elf_build_id(struct pakfire_elf* self) { return NULL; } + // Return NULL if there is no Build ID + if (!length) + return NULL; + // Convert the Build ID to hex self->build_id = __pakfire_hexlify(buffer, length); if (!self->build_id) {