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.
This commit is contained in:
Gary Benson 2017-02-09 15:35:33 +00:00
parent 9d5c5dd77b
commit ff6fa24786
2 changed files with 8 additions and 0 deletions

View File

@ -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.

View File

@ -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;