PR 33697, fuzzer segfault PR 33697 * readelf.c (process_relocs): Don't segfault on no sections.
diff --git a/binutils/readelf.c b/binutils/readelf.c index 1bd9afa..b3f59aa 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c
@@ -10048,13 +10048,11 @@ size_t i; bool found = false; - for (i = 0, section = filedata->section_headers; - i < filedata->file_header.e_shnum; - i++, section++) - { + section = filedata->section_headers; + if (section != NULL) + for (i = 0; i < filedata->file_header.e_shnum; i++, section++) if (display_relocations (section, filedata, do_reloc)) found = true; - } if (do_reloc && ! found) {