From d7d2483aede7611f85d6f578394a49b85acdefec Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 11 May 2004 15:16:10 +0000 Subject: [PATCH] (read_process_output): Grow decoding_buf when needed; this could cause a crash in allocate_string and compact_small_strings. --- src/process.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.2