From ec7f455281b20534c1fbcc3face810ed7585da48 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 13 May 2004 12:52:29 +0000 Subject: (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 1e2bcc3c2ac..4999aebf723 100644 --- a/src/process.c +++ b/src/process.c @@ -4896,6 +4896,8 @@ read_process_output (proc, channel) if (coding->carryover_bytes > 0) { + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) + p->decoding_buf = make_uninit_string (coding->carryover_bytes); bcopy (coding->carryover, SDATA (p->decoding_buf), coding->carryover_bytes); XSETINT (p->decoding_carryover, coding->carryover_bytes); @@ -5002,6 +5004,8 @@ read_process_output (proc, channel) } if (coding->carryover_bytes > 0) { + if (SCHARS (p->decoding_buf) < coding->carryover_bytes) + p->decoding_buf = make_uninit_string (coding->carryover_bytes); bcopy (coding->carryover, SDATA (p->decoding_buf), coding->carryover_bytes); XSETINT (p->decoding_carryover, coding->carryover_bytes); -- cgit v1.2.1