rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Bug in Simmy's readline replacement (with patch)
@ 1992-02-18  2:12 rjc
  0 siblings, 0 replies; only message in thread
From: rjc @ 1992-02-18  2:12 UTC (permalink / raw)
  To: rc

This one took me two days to track down.

edit/editline.c, function insert_string:

Change

    if ((el_end + len) > el_length)

to

    if ((el_end + len + 1) > el_length)

or more efficiently,

    if ((el_end + len) >= el_length)

Simmy forgot to count the trailing 0 that terminates a string.

Without this, we end up storing a 0 past the end of our allocated
block, stomping on the malloc arena, and causing weird crashes in
weird places at unspecified points in the future.

(Sorry, no context diff since I had to hack up other stuff to get rc
to run on my bizarre box that doesn't deserve the name UNIX.)
--
Raymond ``What a ripoff.  I bust my butt day in and day out...''[7f01] Chen
         (Only Brendan will get the quote ref.)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-02-18  2:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-02-18  2:12 Bug in Simmy's readline replacement (with patch) rjc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).