This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/10684] gdb crashes when given enough multiline input


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]