Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [commit/obvious] guard against NULL in TUI code
Date: Tue, 13 Nov 2007 17:07:00 -0000	[thread overview]
Message-ID: <1194973601.6746.72.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

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

[-- Attachment #2: tui-guard-null.diff --]
[-- Type: text/x-patch, Size: 693 bytes --]

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
 	{

                 reply	other threads:[~2007-11-13 17:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194973601.6746.72.camel@localhost.localdomain \
    --to=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox