Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OB PATCH] Fix NULL pointer dereference
@ 2017-02-09 15:39 Gary Benson
  2017-02-09 18:33 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Benson @ 2017-02-09 15:39 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-13 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 15:39 [OB PATCH] Fix NULL pointer dereference Gary Benson
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox