From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5924 invoked by alias); 13 Nov 2007 17:07:11 -0000 Received: (qmail 5776 invoked by uid 22791); 13 Nov 2007 17:07:10 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Nov 2007 17:07:02 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw1.br.ibm.com (Postfix) with ESMTP id B07A732C44A for ; Tue, 13 Nov 2007 15:03:26 -0200 (BRDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.6) with ESMTP id lADH6e6S2682908 for ; Tue, 13 Nov 2007 15:06:44 -0200 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lADH6eBh020701 for ; Tue, 13 Nov 2007 15:06:40 -0200 Received: from [9.18.238.251] (dyn532128.br.ibm.com [9.18.238.251]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lADH6etr020697 for ; Tue, 13 Nov 2007 15:06:40 -0200 Subject: [commit/obvious] guard against NULL in TUI code From: Thiago Jung Bauermann To: gdb-patches Content-Type: multipart/mixed; boundary="=-vCzugDFI1DQUwceyJHEc" Date: Tue, 13 Nov 2007 17:07:00 -0000 Message-Id: <1194973601.6746.72.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00248.txt.bz2 --=-vCzugDFI1DQUwceyJHEc Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 313 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 --=-vCzugDFI1DQUwceyJHEc Content-Disposition: attachment; filename=tui-guard-null.diff Content-Type: text/x-patch; name=tui-guard-null.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 693 2007-11-13 Thiago Jung Bauermann * 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 { --=-vCzugDFI1DQUwceyJHEc--