summaryrefslogtreecommitdiff
path: root/src
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
commit04961398f26a93903176524665af6863f7bb1f1e (patch)
treee3b8dd28c361065befb9066d6d0c5127b5b96a7c /src
parent01ca97a2a32cc7623f211b21c1e0410ca717d97c (diff)
downloademacs-04961398f26a93903176524665af6863f7bb1f1e.tar.gz
(read_process_output): Grow decoding_buf when needed;
this could cause a crash in allocate_string and compact_small_strings.
Diffstat (limited to 'src')
-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);