From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 6EEE6385AC3C for ; Sat, 6 Aug 2022 09:12:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6EEE6385AC3C Received: by mail-pf1-x433.google.com with SMTP id q19so4132633pfg.8 for ; Sat, 06 Aug 2022 02:12:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=PMPBKV6X+01xbYjzibrXhIGPetLU6wHd61pkVgWaVOc=; b=ukH0NDWsnK+Cuq/CfixeYUo06xh2rxen7Jx5KmoC78sxDoOKsKse7TjG36pSCqu/sy M1zC5ID4Yyc1otyEsZkA0HUoyBG4VTHzKRlr5BZSaGL4T10l7HoD9x6yQxullgtK03Bu u86LszsNz6R8rXHrIBLabgtfT+FaICmkQfNVMPUgOcIg7A/sFOJ7WAReEQflct1QNHPy mfTS8GY8kIlETKoxKQPgRKaYjz3YXfHWQUnykrN1T/ZjF3hK5NNBaFhPUBwC+EhoyJD9 skTNNe0TTWWQJRH4qDF/fvOHbUxwVIitBLjoRcg7t86K8EjQ3iR23B7OL6lhFerH7IE4 S8EQ== X-Gm-Message-State: ACgBeo2qaWwAdTNdCUSonEj2WIDSIKfK3x/4Z1pSw2ukB2s7VjyuWoyn 8UFsJ68DJrvGAr5FKa/FDQMA3PBQSFg= X-Google-Smtp-Source: AA6agR7/lqxNnyt7fs8OFTsKQ4+MZekDloDXoPVdY7bL6DKmNA3tPKXMvBLG7W46yLSKF4UH8HPOgQ== X-Received: by 2002:a63:6909:0:b0:41c:9f4f:a63c with SMTP id e9-20020a636909000000b0041c9f4fa63cmr9023728pgc.76.1659777169195; Sat, 06 Aug 2022 02:12:49 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id h11-20020a17090ac38b00b001f55dda84b3sm4333864pjt.22.2022.08.06.02.12.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Aug 2022 02:12:48 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 459BA1142EB7; Sat, 6 Aug 2022 18:42:46 +0930 (ACST) Date: Sat, 6 Aug 2022 18:42:46 +0930 From: Alan Modra To: binutils@sourceware.org Subject: asan: segfault in coff_write_auxent_fname Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3036.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2022 09:12:53 -0000 More fuzzed input file nonsense. * coffgen.c (coff_write_symbol): Don't call coff_write_auxent_fname when extrap is NULL. 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 == 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); -- Alan Modra Australia Development Lab, IBM