Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: Andrew STUBBS <andrew.stubbs@st.com>
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH: Fix TUI null pointer dereference
Date: Sat, 22 Oct 2005 01:16:00 -0000	[thread overview]
Message-ID: <vt24q7d416u.fsf@theseus.home.> (raw)
In-Reply-To: <4353B4A5.3010209@st.com> (Andrew STUBBS's message of "Mon, 17 Oct 2005 15:26:45 +0100")

Andrew STUBBS <andrew.stubbs@st.com> writes:
> 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;

How about wrapping the upcasing loop and the 'if' after it all in one
big 'if (term), starting right after the 'getenv ("TERM")', and then
simplifying the conditional in the upcasing loop?


  reply	other threads:[~2005-10-22  1:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17 14:28 Andrew STUBBS
2005-10-22  1:16 ` Jim Blandy [this message]
2005-10-24 13:32   ` Andrew STUBBS
     [not found]     ` <vt2pspuzwk3.fsf@theseus.home.>
2005-10-24 20:22       ` Andrew STUBBS
2005-10-31 11:56         ` Daniel Jacobowitz
2005-10-31 16:01           ` Andrew STUBBS
2005-10-31 20:34         ` Andrew STUBBS

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=vt24q7d416u.fsf@theseus.home. \
    --to=jimb@redhat.com \
    --cc=andrew.stubbs@st.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