diff options
author | Gary Benson <gbenson@redhat.com> | 2017-02-09 15:35:33 +0000 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2017-02-09 15:37:57 +0000 |
commit | ff6fa24786eb2c03c1af95e2559fa3fd0b2f3893 (patch) | |
tree | ab8489895f553017c95f4c1788c6e42b67ef68d2 /gdb/symtab.c | |
parent | 9d5c5dd77bf91cbeb0ddfd1346bddaee549f9fb3 (diff) | |
download | gdb-ff6fa24786eb2c03c1af95e2559fa3fd0b2f3893.zip gdb-ff6fa24786eb2c03c1af95e2559fa3fd0b2f3893.tar.gz gdb-ff6fa24786eb2c03c1af95e2559fa3fd0b2f3893.tar.bz2 |
Fix NULL pointer dereference
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |