]> git.ipfire.org Git - pakfire.git/commitdiff
ELF: Fix reading note sections
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Jan 2025 18:06:13 +0000 (18:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Jan 2025 18:06:13 +0000 (18:06 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/elf.c

index 42139e730f5a7b1359df08d8b56c6e9563f89dab..dc6a6df34a4c87c08b31e0057ff8dc580ef81e3d 100644 (file)
@@ -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;
        }