changeset 89938:ab6b6e8cffe6

(read_process_output): Grow decoding_buf when needed; this could cause a crash in allocate_string and compact_small_strings.
author Kenichi Handa <handa@m17n.org>
date Thu, 13 May 2004 12:52:29 +0000
parents 48c84a32cc68
children d16398ce9a6f
files src/process.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Thu Apr 29 10:00:27 2004 +0000
+++ b/src/process.c	Thu May 13 12:52:29 2004 +0000
@@ -4896,6 +4896,8 @@
 
       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 @@
 	}
       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);