aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/symtab.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2792509..318dbaf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-09 Gary Benson <gbenson@redhat.com>
+
+ * symtab.c (add_symtab_completions): Prevent NULL pointer
+ dereference.
+
2017-02-08 Pedro Alves <palves@redhat.com>
* interps.c (interp::interp): Remove reference to quiet_p.
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;