This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Patch] another trivial null pointer check to fix another tui segfault.
- From: Hal Ashburner <hal at ashburner dot info>
- To: gdb-patches at sourceware dot org
- Date: Mon, 27 Aug 2012 01:22:55 +1000
- Subject: [Patch] another trivial null pointer check to fix another tui segfault.
the line:
if(locator != NULL
is clearly wrong, it can never be null. Replaced to check the right
thing isn't null fixing a segfault.
Who commits these patches? (Or alternatively reviews and rejects them?)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 666a35f..33a586b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2102-08-27 Hal Ashburner <hal@ashburner.info>
+
+ * tui/tui-stack.c (tui_show_locator_content): Fix null pointer
+ test to test the right thing, fixes segfault.
+
2012-08-24 Siddhesh Poyarekar <siddhesh@redhat.com>
* h8300-tdep.c (h8300_push_dummy_call): Replace unsafe alloca
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 262a6bf..7420b00 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -249,7 +249,7 @@ tui_show_locator_content (void)
locator = tui_locator_win_info_ptr ();
- if (locator != NULL && locator->handle != (WINDOW *) NULL)
+ if (locator->content != NULL && locator->handle != (WINDOW *) NULL)
{
struct tui_win_element *element;