From c29683c5fdfdf5905f36a60403c402daeae9b891 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 9 Jan 2025 16:33:31 +0000 Subject: [PATCH] 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 --- src/pakfire/elf.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.47.3