From 1a3c3aed2af0cb7ea257d0e6cfa59ae52f9e3003 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 3 Jan 2025 18:06:13 +0000 Subject: [PATCH] ELF: Fix reading note sections Signed-off-by: Michael Tremer --- src/pakfire/elf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pakfire/elf.c b/src/pakfire/elf.c index 42139e730..dc6a6df34 100644 --- a/src/pakfire/elf.c +++ b/src/pakfire/elf.c @@ -744,9 +744,10 @@ static int pakfire_elf_check_cf_protection(struct pakfire_elf* self, Elf_Data* d = elf_getdata(section, NULL); // Fetch the .note header - offset = gelf_getnote(data, offset, &nhdr, &offset_name, &offset_data); + offset = gelf_getnote(d, offset, &nhdr, &offset_name, &offset_data); if (!offset) { - ERROR(self->ctx, "Could not read note section: %m\n"); + ERROR(self->ctx, "%s: Could not read note section: %s\n", + self->path, elf_errmsg(-1)); return -errno; } -- 2.47.3