This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] logic error in async event-top/gdb_readline2
- From: msnyder at sonic dot net
- To: msnyder at sonic dot net
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 29 Aug 2007 15:04:27 -0700 (PDT)
- Subject: Re: [PATCH] logic error in async event-top/gdb_readline2
- References: <18681.12.7.175.2.1187467178.squirrel@webmail.sonic.net>
> OK, this function is the asynchronous version of top.c/gdb_readline
> (of which it is also a copy). The main difference is that wherever
> the original (gdb_readline) returns a pointer to an input string,
> this versino (gdb_readline2) passes the pointer to a callback called
> 'input_handler'.
>
> And the problem is that the author neglected to make sure that
> gdb_readline2 also returns after calling the callback.
>
> As a result, we will enter code that was not ment to execute at
> this time, and will access a pointer to memory that has already
> been freed.
Committed.