]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_process_output): Grow decoding_buf when needed;
authorKim F. Storm <storm@cua.dk>
Tue, 11 May 2004 15:16:10 +0000 (15:16 +0000)
committerKim F. Storm <storm@cua.dk>
Tue, 11 May 2004 15:16:10 +0000 (15:16 +0000)
this could cause a crash in allocate_string and compact_small_strings.

src/process.c

index 868143bd12efe027ef8014385b5a80a9fdebba76..bbfc06c308228e86f3bbb30e6076957ed4137e7b 100644 (file)
@@ -4894,6 +4894,8 @@ read_process_output (proc, channel)
        }
 
       carryover = nbytes - coding->consumed;
+      if (SCHARS (p->decoding_buf) < carryover)
+       p->decoding_buf = make_uninit_string (carryover);
       bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
             carryover);
       XSETINT (p->decoding_carryover, carryover);
@@ -4998,6 +5000,8 @@ read_process_output (proc, channel)
            }
        }
       carryover = nbytes - coding->consumed;
+      if (SCHARS (p->decoding_buf) < carryover)
+       p->decoding_buf = make_uninit_string (carryover);
       bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
             carryover);
       XSETINT (p->decoding_carryover, carryover);