From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 95A8E394740B for ; Sat, 17 Dec 2022 08:13:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 95A8E394740B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x430.google.com with SMTP id c13so3208196pfp.5 for ; Sat, 17 Dec 2022 00:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=eqk+oFKmw6qb81zYtxDMBZkxlugQ3i9AvQU0GD3lgiI=; b=PZ8+qJA4XLE3Z0Fq1FasWqgnoCvANfxkz+ibLLt+VPiK8JOHGtudQX7pucQTMQ7eJT 20dBwRIhjYfK/PcXn07YoM0n110VTn2D1igNx/85vhcP8O6tJzrALxtywUaVW0jLB+uz RmRXnq/PzIDrICiSYjspO1fZWggnBNoHJ8fI5C8o5aybwfyLQ98b7HwqEE3IzyJWLkS+ qYAp43P7l3bGeT5QFsrWtEVq+8eyyus9kI1k0TsvSxvzSVVdY8IHbWAZMm8IM6pgYfEJ tO860l6NrXfJRkYOUsVchEFW7rRk9wvZdvM4ckSIXU8w141Cj1OaChW6YTwNc9AJbrs5 BHnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eqk+oFKmw6qb81zYtxDMBZkxlugQ3i9AvQU0GD3lgiI=; b=TLjTerbzAi3t9QeoTiq88oWulbWPV8VUQq8l6etv4oRksQF5PvyB2Pv7lIoR2kvBFA AvUv3njpJOC2DJppygz2p7XQWj842EPfiwLB0nk99nhhgfnlIXirjEk25RoU8pvHJ9oB gsu7ogQQ0SX1LZ6L5j4mjwwWYYfWGsMxy7ahDe/nfz2V6ebXkl7IRZPckgrCuOAXlhOl OoiYzfxnKgr0KXc26z6td0Hdqu2XtDjrTZnjfBoy3dqaUxSoWDjDtStVAo/GXdrSr2Ep cBW1gTU/RsKzDOAAORDN5oCqKfWpT/mvkUdSEDCTk8fqDkca812bfavaUWN7usrX36gL tauQ== X-Gm-Message-State: ANoB5pmt9K9KIRl1XyRcQYI4LlwR4rDVRPXMluJjU94isb4+ShAQpYHG T+H4DrFAbEFyJD/VbjqkjuLLEE4XSTM= X-Google-Smtp-Source: AA0mqf5QyAPxVufeR+yIdQ6B7rU2bJKwIQ8Y8lWYQocdT1OpdCeA2iSMbDiY8AZSpzfSFTc348iD6g== X-Received: by 2002:aa7:96d4:0:b0:576:8e8d:6675 with SMTP id h20-20020aa796d4000000b005768e8d6675mr39364599pfq.19.1671264794354; Sat, 17 Dec 2022 00:13:14 -0800 (PST) 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 c197-20020a621cce000000b00573a9d13e9esm2670558pfc.36.2022.12.17.00.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 00:13:13 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 6F8391142DEE; Sat, 17 Dec 2022 18:43:11 +1030 (ACDT) Date: Sat, 17 Dec 2022 18:43:11 +1030 From: Alan Modra To: binutils@sourceware.org Subject: asan: elf.c:12621:18: applying zero offset to null pointer Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.9 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: That's this line in elf_parse_notes: while (p < buf + size) * elf.c (_bfd_elf_make_section_from_shdr): Don't call elf_parse_notes when sh_size is zero. diff --git a/bfd/elf.c b/bfd/elf.c index 5548efc44e4..7317c52faaa 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1110,7 +1110,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, /* We do not parse the PT_NOTE segments as we are interested even in the separate debug info files which may have the segments offsets corrupted. PT_NOTEs from the core files are currently not parsed using BFD. */ - if (hdr->sh_type == SHT_NOTE) + if (hdr->sh_type == SHT_NOTE && hdr->sh_size != 0) { bfd_byte *contents; -- Alan Modra Australia Development Lab, IBM