Message ID | 20190809191313.25200-1-pedromfc@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 102893 invoked by alias); 9 Aug 2019 19:13:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 102823 invoked by uid 89); 9 Aug 2019 19:13:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Aug 2019 19:13:44 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x79J7eEu087566; Fri, 9 Aug 2019 15:13:42 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2u9cd1nevy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2019 15:13:42 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x79J7lO9088069; Fri, 9 Aug 2019 15:13:41 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 2u9cd1nevk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2019 15:13:41 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x79JBjFV018442; Fri, 9 Aug 2019 19:13:41 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03dal.us.ibm.com with ESMTP id 2u51w7g4h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2019 19:13:41 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x79JDdDr54985212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Aug 2019 19:13:40 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0CA77805E; Fri, 9 Aug 2019 19:13:39 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E8607805C; Fri, 9 Aug 2019 19:13:39 +0000 (GMT) Received: from pedro.localdomain (unknown [9.80.195.227]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 9 Aug 2019 19:13:39 +0000 (GMT) Received: by pedro.localdomain (Postfix, from userid 1000) id 699EA3C0374; Fri, 9 Aug 2019 16:13:34 -0300 (-03) From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com> To: gdb-patches@sourceware.org Cc: tom@tromey.com, kevinb@redhat.com Subject: [PATCH] Fix access to uninitialized variable in fill_in_stop_func Date: Fri, 9 Aug 2019 16:13:13 -0300 Message-Id: <20190809191313.25200-1-pedromfc@linux.ibm.com> In-Reply-To: <20190808104200.6a387ac8@f29-4.lan> References: <20190808104200.6a387ac8@f29-4.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Commit Message
Pedro Franco de Carvalho
Aug. 9, 2019, 7:13 p.m. UTC
This patch changes find_pc_partial_function so that *block is set to nullptr when it fails, so that fill_in_stop_func won't access an uninitialized variable. gdb/ChangeLog: YYYY-MM-DD Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * blockframe.c (find_pc_partial_function): Set *block to nullptr when the function fails. --- gdb/blockframe.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On Fri, 9 Aug 2019 16:13:13 -0300 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> wrote: > This patch changes find_pc_partial_function so that *block is set to > nullptr when it fails, so that fill_in_stop_func won't access an > uninitialized variable. > > gdb/ChangeLog: > YYYY-MM-DD Pedro Franco de Carvalho <pedromfc@linux.ibm.com> > > * blockframe.c (find_pc_partial_function): Set *block to nullptr > when the function fails. Okay. Kevin
Kevin Buettner <kevinb@redhat.com> writes:
> Okay.
Thanks! Pushed.
--
Pedro Franco de Carvalho
>>>>> "Pedro" == Pedro Franco de Carvalho <pedromfc@linux.ibm.com> writes:
Pedro> This patch changes find_pc_partial_function so that *block is set to
Pedro> nullptr when it fails, so that fill_in_stop_func won't access an
Pedro> uninitialized variable.
Pedro> gdb/ChangeLog:
Pedro> YYYY-MM-DD Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
Pedro> * blockframe.c (find_pc_partial_function): Set *block to nullptr
Pedro> when the function fails.
Thanks. This is ok.
Tom
diff --git a/gdb/blockframe.c b/gdb/blockframe.c index fe7807b87a..4462274f46 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -331,6 +331,8 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address, *address = 0; if (endaddr != NULL) *endaddr = 0; + if (block != nullptr) + *block = nullptr; return 0; }