From patchwork Thu Feb 9 15:39:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 19196 Received: (qmail 25741 invoked by alias); 9 Feb 2017 15:39:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25720 invoked by uid 89); 9 Feb 2017 15:39:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_40, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=cust, Hx-languages-length:680, quit, global_block X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Feb 2017 15:39:45 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8786E9F731 for ; Thu, 9 Feb 2017 15:39:45 +0000 (UTC) Received: from blade.nx ([10.33.36.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v19FdhL7030310 for ; Thu, 9 Feb 2017 10:39:45 -0500 Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 30743816CC34 for ; Thu, 9 Feb 2017 15:39:42 +0000 (GMT) From: Gary Benson To: gdb-patches@sourceware.org Subject: [OB PATCH] Fix NULL pointer dereference Date: Thu, 9 Feb 2017 15:39:39 +0000 Message-Id: <1486654779-20073-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit fixes a segmentation fault on tab completion when certain debuginfo is installed: https://bugzilla.redhat.com/show_bug.cgi?id=1398387 gdb/ChangeLog: * symtab.c (add_symtab_completions): Prevent NULL pointer dereference. --- gdb/ChangeLog | 5 +++++ gdb/symtab.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gdb/symtab.c b/gdb/symtab.c index 356f480..2c141e5 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -5163,6 +5163,9 @@ add_symtab_completions (struct compunit_symtab *cust, struct block_iterator iter; int i; + if (cust == NULL) + return; + for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++) { QUIT;