From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22042 invoked by alias); 17 Oct 2005 14:28:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21844 invoked by uid 22791); 17 Oct 2005 14:28:24 -0000 Received: from lon-del-03.spheriq.net (HELO lon-del-03.spheriq.net) (195.46.50.99) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 17 Oct 2005 14:28:24 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-03.spheriq.net with ESMTP id j9HESJtp007322 for ; Mon, 17 Oct 2005 14:28:19 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-01.spheriq.net with ESMTP id j9HESIds001644 for ; Mon, 17 Oct 2005 14:28:18 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id j9HESFwO009619 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 17 Oct 2005 14:28:17 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CA908DA43 for ; Mon, 17 Oct 2005 14:28:10 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id D3385474B1; Mon, 17 Oct 2005 14:30:54 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A9119759B4 for ; Mon, 17 Oct 2005 14:30:54 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1F15C474B6 for ; Mon, 17 Oct 2005 14:30:54 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CCW00741 (AUTH "andrew stubbs"); Mon, 17 Oct 2005 15:28:08 +0100 (BST) Message-ID: <4353B4A5.3010209@st.com> Date: Mon, 17 Oct 2005 14:28:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: PATCH: Fix TUI null pointer dereference Content-Type: multipart/mixed; boundary="------------020108050705090101090106" X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 2.3.0 X-SW-Source: 2005-10/txt/msg00134.txt.bz2 This is a multi-part message in MIME format. --------------020108050705090101090106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 360 Hi, The attached patch fixes a NULL pointer dereference starting the TUI when the TERM environment variable is not set. This is a particular problem on windows where that variable is not usually set. 2005-10-17 Andrew Stubbs * tui/tui-command.c (tui_dispatch_ctrl_char): Test output of getenv() before using it. Andrew Stubbs --------------020108050705090101090106 Content-Type: text/plain; name="tui-NULL-pointer.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tui-NULL-pointer.patch" Content-length: 624 Index: src/gdb/tui/tui-command.c =================================================================== --- src.orig/gdb/tui/tui-command.c 2004-02-16 21:05:09.000000000 +0000 +++ src/gdb/tui/tui-command.c 2005-10-17 14:33:06.000000000 +0100 @@ -70,7 +70,7 @@ tui_dispatch_ctrl_char (unsigned int ch) term = (char *) getenv ("TERM"); for (i = 0; (term && term[i]); i++) term[i] = toupper (term[i]); - if ((strcmp (term, "XTERM") == 0) && key_is_start_sequence (ch)) + if (term && (strcmp (term, "XTERM") == 0) && key_is_start_sequence (ch)) { unsigned int page_ch = 0; unsigned int tmp_char; --------------020108050705090101090106--