aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorKenichi Handa2004-05-13 12:52:29 +0000
committerKenichi Handa2004-05-13 12:52:29 +0000
commit04961398f26a93903176524665af6863f7bb1f1e (patch)
treee3b8dd28c361065befb9066d6d0c5127b5b96a7c /src/process.c
parent01ca97a2a32cc7623f211b21c1e0410ca717d97c (diff)
downloademacs-04961398f26a93903176524665af6863f7bb1f1e.tar.gz
emacs-04961398f26a93903176524665af6863f7bb1f1e.zip
(read_process_output): Grow decoding_buf when needed;
this could cause a crash in allocate_string and compact_small_strings.
Diffstat (limited to 'src/process.c')
-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)
4896 4896
4897 if (coding->carryover_bytes > 0) 4897 if (coding->carryover_bytes > 0)
4898 { 4898 {
4899 if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
4900 p->decoding_buf = make_uninit_string (coding->carryover_bytes);
4899 bcopy (coding->carryover, SDATA (p->decoding_buf), 4901 bcopy (coding->carryover, SDATA (p->decoding_buf),
4900 coding->carryover_bytes); 4902 coding->carryover_bytes);
4901 XSETINT (p->decoding_carryover, coding->carryover_bytes); 4903 XSETINT (p->decoding_carryover, coding->carryover_bytes);
@@ -5002,6 +5004,8 @@ read_process_output (proc, channel)
5002 } 5004 }
5003 if (coding->carryover_bytes > 0) 5005 if (coding->carryover_bytes > 0)
5004 { 5006 {
5007 if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
5008 p->decoding_buf = make_uninit_string (coding->carryover_bytes);
5005 bcopy (coding->carryover, SDATA (p->decoding_buf), 5009 bcopy (coding->carryover, SDATA (p->decoding_buf),
5006 coding->carryover_bytes); 5010 coding->carryover_bytes);
5007 XSETINT (p->decoding_carryover, coding->carryover_bytes); 5011 XSETINT (p->decoding_carryover, coding->carryover_bytes);