From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [OB PATCH] Fix NULL pointer dereference
Date: Thu, 09 Feb 2017 15:39:00 -0000 [thread overview]
Message-ID: <1486654779-20073-1-git-send-email-gbenson@redhat.com> (raw)
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;
--
1.8.3.1
next reply other threads:[~2017-02-09 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 15:39 Gary Benson [this message]
2017-02-09 18:33 ` Pedro Alves
2017-02-10 11:19 ` Gary Benson
2017-02-10 12:58 ` Pedro Alves
2017-02-13 12:10 ` Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486654779-20073-1-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).