This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit/obvious] guard against NULL in TUI code


Hi,

I just committed this patch, which fixes a segfault that can be
triggered by:

$ gdb
(gdb) focus cmd
(gdb) focus prev

I just added a NULL check to tui_prev_win which was already present in
the corresponding tui_next_win function.
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
2007-11-13  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* tui/tui-data.c (tui_prev_win): Guard against NULL.

Index: tui/tui-data.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-data.c,v
retrieving revision 1.22
diff -u -r1.22 tui-data.c
--- tui/tui-data.c	23 Aug 2007 18:08:50 -0000	1.22
+++ tui/tui-data.c	13 Nov 2007 16:56:31 -0000
@@ -370,7 +370,8 @@
     type = cur_win->generic.type - 1;
   while (type != cur_win->generic.type && (prev == NULL))
     {
-      if (tui_win_list[type]->generic.is_visible)
+      if (tui_win_list[type]
+	  && tui_win_list[type]->generic.is_visible)
 	prev = tui_win_list[type];
       else
 	{

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]