This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/10684] gdb crashes when given enough multiline input
- From: "john dot wright at hp dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 23 Sep 2009 00:12:10 -0000
- Subject: [Bug gdb/10684] gdb crashes when given enough multiline input
- References: <20090922234523.10684.john.wright@hp.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From john dot wright at hp dot com 2009-09-23 00:12 -------
Created an attachment (id=4222)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4222&action=view)
Proposed patch
command_handler: Terminate linebuffer before xstrdup
If a line ends in a backslash, we copy linebuffer into a global
readline_input_state variable, using xstrdup. But the operations
leading to this point do not guarantee that linebuffer is terminated.
Thus, when we later use xstrcpy to copy it back into the linebuffer
variable, linebuffer will not have enough space allocated to hold
the result.
This patch ensures linebuffer is terminated before calling xstrdup.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10684
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.