From patchwork Sun Mar 19 11:51:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 71751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp688765wrt; Sun, 19 Mar 2023 04:51:58 -0700 (PDT) X-Google-Smtp-Source: AK7set+6JPP+Gra4OT2aPkLIRxM2/jWlWJhSJLRK4S8qh3IuDeyRqVk/mEzBDukmXvY30pVY1vpy X-Received: by 2002:a17:906:394d:b0:88c:a43d:81bc with SMTP id g13-20020a170906394d00b0088ca43d81bcmr5215622eje.58.1679226718367; Sun, 19 Mar 2023 04:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679226718; cv=none; d=google.com; s=arc-20160816; b=M2cnceAa7JNuv3uIxjNjqqppI/sO8NCnQImYC/nnc+fiUhcbHYxfJ4kCxzZNFt00Ip h+W7ko7hK7d3QVaVjJYTi+0qg28FyF6+boG89I96fz1wP5YTwMhP+XCb/edPe/u+Kv8U c452djjb9B6TSLxYjvbZnUYR04agFurI8AaJzg2ibg9vV1xlh9B49/viu0G/VpkuZ7MN /8y+cWkxMMtb31SaMKS4sslqWAZtU0FvBJMYiG4HuCcJa1uYtC8H0c1X8ThuRvmz1Tl2 lUlfPisG9Td0atRP9gTi+UHM2btKyj600EyK9Pa9z8iT7pTi6sG1C+ejSNkJqNyJz0So boNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=da2kp60pv8S5yPSpEupq3GTnEC+6rMw3+NTlxNC74Cs=; b=Mw/O0dnVlN9QqPgtso31Amfa+ViVbp++waBvVH7IcghtrIf5UnL3lH+77HXcZ7dI/w NrpOW++EvGVifBcLVgD72sIyJvKG3+cxoyPEA3clHiBzmoqDev+me6uAMeOLSRwGOBjh Q9g4TEksg/fQFqjbZdgZreevpYYmFc3M/WH1GTIdCsRdYH2nNhqXT6HDHBeOhzYp8orq kanfJ2ITeiRxQ+uQ6Svi7VZ1ULSjDRVxrrmTDvU23aSI2lykDqhrpgRxmCJXOy8KhkiG 8z0p4IDnv6276TraZDphTLY+yTVAIm7wVVPWB5LcMyJf02ZWVGt6FMMB0RIqT4UY5VOH lDUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=aNZQ8k2A; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x25-20020a170906b09900b0092782ff4502si7518822ejy.401.2023.03.19.04.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 04:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=aNZQ8k2A; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00B053858033 for ; Sun, 19 Mar 2023 11:51:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00B053858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679226716; bh=da2kp60pv8S5yPSpEupq3GTnEC+6rMw3+NTlxNC74Cs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aNZQ8k2AsY5TPLqxrCtESxloSXNfdHjP3Xgz21+SW0KTH2V8L3hsJpg5DS5OZ2cbv 56CmJCwSTKmoRpmAu+rpUhqCP24YjcXNTUackJqm1wF9+YBUTMi0MRbM1DxNvlnsNp T9fgeYJuxpEZJNTdmQkGqccS3uirIi/13/0tZwRw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 6D8B23858C2B for ; Sun, 19 Mar 2023 11:51:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D8B23858C2B Received: by mail-pj1-x1034.google.com with SMTP id j3-20020a17090adc8300b0023d09aea4a6so13660586pjv.5 for ; Sun, 19 Mar 2023 04:51:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679226707; 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=da2kp60pv8S5yPSpEupq3GTnEC+6rMw3+NTlxNC74Cs=; b=ANDgH2PYnn+5xpRgTqKVGLjZ3Sc+F/wMQLTjtfodXREvkh9Y57W0BLqSeB+SIjxMih 9By53JMCCbX/SuxjfbyJtRB2ML2oZa7W6JJhZbXQJIZeqUraCaFsDmW6V9lp8hvD6H2p Mq/j/BoKa9dYjfswHjdd4Q+3jqqPslkiqDqFRU7Rhgz2wUmTEcv1LtW/UASJVrUvSd1O ZMllP3mUB0cZQMkglfxDT3gnLPwfRPY3B6m9eUYM1oq//WBCVSJKvKO6EGmf6iKqOI7S BcIZWp4wW7IvS2P8HA948jdLGN4KOzp/brlG+FPIRmgOmXolHq/yobiRt2Ia7iMLfJvq HbRA== X-Gm-Message-State: AO0yUKVAYTrtNDTPZgOao1z2VU5J1fH6xCNIszM0wPqBoiehMhg3yzWl liqBoh7rPSQqdU4mlVR8+2GQm42DlXg= X-Received: by 2002:a17:90b:4c4b:b0:23b:3699:b8a9 with SMTP id np11-20020a17090b4c4b00b0023b3699b8a9mr15310640pjb.17.1679226707351; Sun, 19 Mar 2023 04:51:47 -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 g7-20020a170902934700b0019d397b0f18sm4592850plp.214.2023.03.19.04.51.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 04:51:46 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 84BB61142CE7; Sun, 19 Mar 2023 22:21:44 +1030 (ACDT) Date: Sun, 19 Mar 2023 22:21:44 +1030 To: binutils@sourceware.org Subject: Another sanity check for read_section_stabs_debugging_info Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.2 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 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-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760796835565585359?= X-GMAIL-MSGID: =?utf-8?q?1760796835565585359?= * rddbg.c (read_section_stabs_debugging_info): Ignore invalid stab sections with size less than 12 bytes. diff --git a/binutils/rddbg.c b/binutils/rddbg.c index 1a888778312..15081c3f7c7 100644 --- a/binutils/rddbg.c +++ b/binutils/rddbg.c @@ -119,6 +119,7 @@ read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount, strsec = bfd_get_section_by_name (abfd, names[i].strsecname); if (sec != NULL && (bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0 + && bfd_section_size (sec) >= 12 && strsec != NULL && (bfd_section_flags (strsec) & SEC_HAS_CONTENTS) != 0) {