This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[OB PATCH] Fix NULL pointer dereference
- From: Gary Benson <gbenson at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 9 Feb 2017 15:39:39 +0000
- Subject: [OB PATCH] Fix NULL pointer dereference
- Authentication-results: sourceware.org; auth=none
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