* [RFA] small patch to command_line_handler
@ 2002-06-07 13:12 Martin M. Hunt
2002-06-07 14:52 ` Elena Zannoni
0 siblings, 1 reply; 4+ messages in thread
From: Martin M. Hunt @ 2002-06-07 13:12 UTC (permalink / raw)
To: gdb-patches
Please check this carefully because I don't really understand the code here.
I'm trying to track down some memory trashing and random crashes and the
command line handler is reading memory it didn't allocate, which is mostly
harmless, but annoying and bad programming. So here's a proposed fix.
--
Martin Hunt
GDB Engineer
Red Hat, Inc.
2002-06-07 Martin M. Hunt <hunt@redhat.com>
* event-top.c (command_line_handler): Don't read past
beginning of buffer.
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.20
diff -u -u -r1.20 event-top.c
--- event-top.c 27 Mar 2002 21:20:15 -0000 1.20
+++ event-top.c 7 Jun 2002 20:08:32 -0000
@@ -681,7 +681,7 @@
xfree (rl); /* Allocated in readline. */
- if (*(p - 1) == '\\')
+ if (p > linebuffer && *(p - 1) == '\\')
{
p--; /* Put on top of '\'. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] small patch to command_line_handler
2002-06-07 13:12 [RFA] small patch to command_line_handler Martin M. Hunt
@ 2002-06-07 14:52 ` Elena Zannoni
2002-06-07 17:37 ` Martin M. Hunt
0 siblings, 1 reply; 4+ messages in thread
From: Elena Zannoni @ 2002-06-07 14:52 UTC (permalink / raw)
To: Martin M. Hunt; +Cc: gdb-patches
Martin M. Hunt writes:
> Please check this carefully because I don't really understand the code here.
>
> I'm trying to track down some memory trashing and random crashes and the
> command line handler is reading memory it didn't allocate, which is mostly
> harmless, but annoying and bad programming. So here's a proposed fix.
>
Hmmm, odd. Martin, can you look at what happened to this thread that
reported the very same error? I thought this got fixed.
http://sources.redhat.com/ml/gdb-patches/2002-03/msg00533.html
Thanks
Elena
> --
> Martin Hunt
> GDB Engineer
> Red Hat, Inc.
>
> 2002-06-07 Martin M. Hunt <hunt@redhat.com>
>
> * event-top.c (command_line_handler): Don't read past
> beginning of buffer.
>
> Index: event-top.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/event-top.c,v
> retrieving revision 1.20
> diff -u -u -r1.20 event-top.c
> --- event-top.c 27 Mar 2002 21:20:15 -0000 1.20
> +++ event-top.c 7 Jun 2002 20:08:32 -0000
> @@ -681,7 +681,7 @@
>
> xfree (rl); /* Allocated in readline. */
>
> - if (*(p - 1) == '\\')
> + if (p > linebuffer && *(p - 1) == '\\')
> {
> p--; /* Put on top of '\'. */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] small patch to command_line_handler
2002-06-07 14:52 ` Elena Zannoni
@ 2002-06-07 17:37 ` Martin M. Hunt
2002-06-12 18:43 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Martin M. Hunt @ 2002-06-07 17:37 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Friday 07 June 2002 02:51 pm, Elena Zannoni wrote:
> Martin M. Hunt writes:
> > Please check this carefully because I don't really understand the code
> > here.
> >
> > I'm trying to track down some memory trashing and random crashes and the
> > command line handler is reading memory it didn't allocate, which is
> > mostly harmless, but annoying and bad programming. So here's a proposed
> > fix.
>
> Hmmm, odd. Martin, can you look at what happened to this thread that
> reported the very same error? I thought this got fixed.
>
> http://sources.redhat.com/ml/gdb-patches/2002-03/msg00533.html
Jason reported the same bug and posted a patch that appears logically
equivalent to mine. Andrew approved it. There was much discussion of
related things but Jason never committed his patch.
--
Martin Hunt
GDB Engineer
Red Hat, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] small patch to command_line_handler
2002-06-07 17:37 ` Martin M. Hunt
@ 2002-06-12 18:43 ` Andrew Cagney
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2002-06-12 18:43 UTC (permalink / raw)
To: Martin M. Hunt; +Cc: Elena Zannoni, gdb-patches
> On Friday 07 June 2002 02:51 pm, Elena Zannoni wrote:
>
>> Martin M. Hunt writes:
>> > Please check this carefully because I don't really understand the code
>> > here.
>> >
>> > I'm trying to track down some memory trashing and random crashes and the
>> > command line handler is reading memory it didn't allocate, which is
>> > mostly harmless, but annoying and bad programming. So here's a proposed
>> > fix.
>>
>> Hmmm, odd. Martin, can you look at what happened to this thread that
>> reported the very same error? I thought this got fixed.
>>
>> http://sources.redhat.com/ml/gdb-patches/2002-03/msg00533.html
>
>
> Jason reported the same bug and posted a patch that appears logically
> equivalent to mine. Andrew approved it. There was much discussion of
> related things but Jason never committed his patch.
I'll approve this version then :-)
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-06-13 1:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-07 13:12 [RFA] small patch to command_line_handler Martin M. Hunt
2002-06-07 14:52 ` Elena Zannoni
2002-06-07 17:37 ` Martin M. Hunt
2002-06-12 18:43 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox