[PATCH] logic error in async event-top/gdb_readline2

msnyder@sonic.net msnyder@sonic.net
Sat Aug 18 19:59:00 GMT 2007


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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 218.txt
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070818/c2d2ebff/attachment.txt>


More information about the Gdb-patches mailing list