From: Alan Modra Date: Sat, 13 Jun 2026 00:57:22 +0000 (+0930) Subject: oss-fuzz: vms-alpha segfault in image_write_section X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95451ea43a7e2e4aa806ee7405e9167b2ee653c1;p=thirdparty%2Fbinutils-gdb.git oss-fuzz: vms-alpha segfault in image_write_section Yet another case where a fuzzed object file triggers a crash in the vms-alpha support. * vms-alpha.c (image_write_section): Don't segfault on NULL image_section. --- diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index 8454ab6ebdc..24b05f90bea 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -1603,7 +1603,8 @@ image_write_section (bfd *abfd) { asection *sec = PRIV (image_section); - if ((sec->flags & SEC_IN_MEMORY) != 0 && sec->contents == NULL) + if (sec == NULL + || ((sec->flags & SEC_IN_MEMORY) != 0 && sec->contents == NULL)) return NULL; return sec; }