* [commit] Fix TUI null pointer dereference
@ 2005-11-01 16:58 Andrew STUBBS
2005-11-01 17:01 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Andrew STUBBS @ 2005-11-01 16:58 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 180 bytes --]
Sorry I have not sent this before. I assumed the [commit] messages were
just from people who had not previously posted a [patch].
The committed patch is attached.
Andrew Stubbs
[-- Attachment #2: tui-NULL-pointer.patch --]
[-- Type: text/plain, Size: 1762 bytes --]
2005-10-31 Andrew Stubbs <andrew.stubbs@st.com>
* tui/tui-command.c (tui_dispatch_ctrl_char): Test output of
getenv() before using it.
Index: src/gdb/tui/tui-command.c
===================================================================
--- src.orig/gdb/tui/tui-command.c 2005-10-24 13:58:38.000000000 +0100
+++ src/gdb/tui/tui-command.c 2005-10-24 18:56:04.000000000 +0100
@@ -68,33 +68,36 @@ tui_dispatch_ctrl_char (unsigned int ch)
** Seems like a bug in the curses library?
*/
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)
{
- unsigned int page_ch = 0;
- unsigned int tmp_char;
-
- tmp_char = 0;
- while (!key_is_end_sequence (tmp_char))
+ for (i = 0; term[i]; i++)
+ term[i] = toupper (term[i]);
+ if ((strcmp (term, "XTERM") == 0) && key_is_start_sequence (ch))
{
- tmp_char = (int) wgetch (w);
- if (tmp_char == ERR)
- {
- return ch;
- }
- if (!tmp_char)
- break;
- if (tmp_char == 53)
- page_ch = KEY_PPAGE;
- else if (tmp_char == 54)
- page_ch = KEY_NPAGE;
- else
+ unsigned int page_ch = 0;
+ unsigned int tmp_char;
+
+ tmp_char = 0;
+ while (!key_is_end_sequence (tmp_char))
{
- return 0;
+ tmp_char = (int) wgetch (w);
+ if (tmp_char == ERR)
+ {
+ return ch;
+ }
+ if (!tmp_char)
+ break;
+ if (tmp_char == 53)
+ page_ch = KEY_PPAGE;
+ else if (tmp_char == 54)
+ page_ch = KEY_NPAGE;
+ else
+ {
+ return 0;
+ }
}
+ ch_copy = page_ch;
}
- ch_copy = page_ch;
}
switch (ch_copy)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [commit] Fix TUI null pointer dereference
2005-11-01 16:58 [commit] Fix TUI null pointer dereference Andrew STUBBS
@ 2005-11-01 17:01 ` Daniel Jacobowitz
2005-11-01 17:06 ` Andrew STUBBS
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-11-01 17:01 UTC (permalink / raw)
To: Andrew STUBBS; +Cc: gdb-patches
On Tue, Nov 01, 2005 at 04:56:06PM +0000, Andrew STUBBS wrote:
> Sorry I have not sent this before. I assumed the [commit] messages were
> just from people who had not previously posted a [patch].
No problem.
Normally [commit] is "I'm going to commit this". All I'm asking for is
a reply to the approval saying "I have now committed this".
The point is just for bookkeeping; easier to keep track of which
approved patches have been checked in and which have been dropped, if
there's a commit message in the original thread. We've had some
problems in the past with approved patches being lost.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [commit] Fix TUI null pointer dereference
2005-11-01 17:01 ` Daniel Jacobowitz
@ 2005-11-01 17:06 ` Andrew STUBBS
0 siblings, 0 replies; 3+ messages in thread
From: Andrew STUBBS @ 2005-11-01 17:06 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
> On Tue, Nov 01, 2005 at 04:56:06PM +0000, Andrew STUBBS wrote:
>
>>Sorry I have not sent this before. I assumed the [commit] messages were
>>just from people who had not previously posted a [patch].
>
>
> No problem.
>
> Normally [commit] is "I'm going to commit this". All I'm asking for is
> a reply to the approval saying "I have now committed this".
>
> The point is just for bookkeeping; easier to keep track of which
> approved patches have been checked in and which have been dropped, if
> there's a commit message in the original thread. We've had some
> problems in the past with approved patches being lost.
>
Sorry, I've now misundertood twice. Ah well, we live and learn.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-01 17:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-01 16:58 [commit] Fix TUI null pointer dereference Andrew STUBBS
2005-11-01 17:01 ` Daniel Jacobowitz
2005-11-01 17:06 ` Andrew STUBBS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox