GCC10 -fanalyzer with -flto notices __gelf_getehdr_rdlock can fail
and that the result of the call in __libelf_set_rawdata_wrlock isn't
checked, which can cause a dereference of NULL.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2020-05-08 Mark Wielaard <mark@klomp.org>
+
+ * elf_getdata.c (__libelf_set_rawdata_wrlock): Check
+ __gelf_getehdr_rdlock return value.
+
2020-04-25 Mark Wielaard <mark@klomp.org>
* elf_compress.c (__libelf_compress): Remove free (out_buf).
{
GElf_Ehdr ehdr_mem;
GElf_Ehdr *ehdr = __gelf_getehdr_rdlock (elf, &ehdr_mem);
+ if (unlikely (ehdr == NULL))
+ return 1;
entsize = SH_ENTSIZE_HASH (ehdr);
}
else