# commit d1458933830456e54223d9fc61f0d9b3a19256f5 # tree 98864afbaa67a592824cc9f0c846bce8efde33c9 tree # parent 6fe4e5bd10b996428a557e036c07c5839a8e0a49 commit | diff # PR32858 ld segfault on fuzzed object # # We missed one place where it is necessary to check for empty groups. # # PR 32858 # * elflink.c (elf_gc_sweep): Protect against empty group. --- binutils.orig/bfd/elflink.c 2025-06-30 15:59:11.706908490 +0100 +++ binutils-2.41/bfd/elflink.c 2025-06-30 16:00:32.282299523 +0100 @@ -14115,7 +14115,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link if (o->flags & SEC_GROUP) { asection *first = elf_next_in_group (o); - o->gc_mark = first->gc_mark; + if (first != NULL) + o->gc_mark = first->gc_mark; } if (o->gc_mark)