From: Kim F. Storm Date: Tue, 11 May 2004 15:16:10 +0000 (+0000) Subject: (read_process_output): Grow decoding_buf when needed; X-Git-Tag: ttn-vms-21-2-B4~6272 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d7d2483aede7611f85d6f578394a49b85acdefec;p=emacs.git (read_process_output): Grow decoding_buf when needed; this could cause a crash in allocate_string and compact_small_strings. --- diff --git a/src/process.c b/src/process.c index 868143bd12e..bbfc06c3082 100644 --- a/src/process.c +++ b/src/process.c @@ -4894,6 +4894,8 @@ read_process_output (proc, channel) } carryover = nbytes - coding->consumed; + if (SCHARS (p->decoding_buf) < carryover) + p->decoding_buf = make_uninit_string (carryover); bcopy (chars + coding->consumed, SDATA (p->decoding_buf), carryover); XSETINT (p->decoding_carryover, carryover); @@ -4998,6 +5000,8 @@ read_process_output (proc, channel) } } carryover = nbytes - coding->consumed; + if (SCHARS (p->decoding_buf) < carryover) + p->decoding_buf = make_uninit_string (carryover); bcopy (chars + coding->consumed, SDATA (p->decoding_buf), carryover); XSETINT (p->decoding_carryover, carryover);