summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2004-05-13 12:52:29 +0000
committerKenichi Handa <handa@m17n.org>2004-05-13 12:52:29 +0000
commitec7f455281b20534c1fbcc3face810ed7585da48 (patch)
treecc9c30e7fd8405e5375e20cbc8db38a45e3a695f
parent89df47c040abfd452c84d45d01bf617b83e9b884 (diff)
downloademacs-ec7f455281b20534c1fbcc3face810ed7585da48.tar.gz
(read_process_output): Grow decoding_buf when needed;
this could cause a crash in allocate_string and compact_small_strings.
-rw-r--r--src/process.c4
1 files changed, 4 insertions, 0 deletions
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);