From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id E1B68385BAF0; Sat, 6 Aug 2022 09:13:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1B68385BAF0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] asan: segfault in coff_write_auxent_fname X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: f7a559d5e11c5c023554b48b661aabbcc2c87cb8 X-Git-Newrev: 431d48ef288983b62df2afb435dc8c6101a34cf8 Message-Id: <20220806091358.E1B68385BAF0@sourceware.org> Date: Sat, 6 Aug 2022 09:13:58 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2022 09:13:59 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D431d48ef2889= 83b62df2afb435dc8c6101a34cf8 commit 431d48ef288983b62df2afb435dc8c6101a34cf8 Author: Alan Modra Date: Sat Aug 6 17:36:32 2022 +0930 asan: segfault in coff_write_auxent_fname =20 More fuzzed input file nonsense. =20 * coffgen.c (coff_write_symbol): Don't call coff_write_auxent_f= name when extrap is NULL. Diff: --- bfd/coffgen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 07b3fb446aa..4d2b82e4a6f 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1058,7 +1058,8 @@ coff_write_symbol (bfd *abfd, /* Adjust auxent only if this isn't the filename auxiliary entry. */ if (native->u.syment.n_sclass =3D=3D C_FILE - && (native + j + 1)->u.auxent.x_file.x_ftype) + && (native + j + 1)->u.auxent.x_file.x_ftype + && (native + j + 1)->extrap) coff_write_auxent_fname (abfd, (char *) (native + j + 1)->extrap, &(native + j + 1)->u.auxent, strtab, hash);