[Bug,default/29346] SIGFPE when doing abipkgdiff --self-check of aisleriot-debuginfo-3.22.21-1.fc36.aarch64.rpm
Commit Message
https://sourceware.org/bugzilla/show_bug.cgi?id=29346
--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
I probably should have tried to compile it at least.
This actually compiles (but I haven't replicated the original issue):
if (data == NULL)
@@ -16634,8 +16634,11 @@ get_soname_of_elf_file(const string& path, string
&soname)
Elf_Scn* scn = gelf_offscn (elf, phdr->p_offset);
GElf_Shdr shdr_mem;
GElf_Shdr* shdr = gelf_getshdr (scn, &shdr_mem);
+ size_t entsize = (shdr != NULL && shdr->sh_entsize != 0
+ ? shdr->sh_entsize
+ : gelf_fsize (elf, ELF_T_DYN, 1, EV_CURRENT));
int maxcnt = (shdr != NULL
- ? shdr->sh_size / shdr->sh_entsize : INT_MAX);
+ ? shdr->sh_size / entsize : INT_MAX);
ABG_ASSERT (shdr == NULL || shdr->sh_type == SHT_DYNAMIC);
Elf_Data* data = elf_getdata (scn, NULL);