Mercurial > emacs
changeset 55534:43894b273b5e
(read_process_output): Grow decoding_buf when needed;
this could cause a crash in allocate_string and compact_small_strings.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 11 May 2004 15:16:10 +0000 |
parents | fd59a77109e5 |
children | de7b52d8b034 |
files | src/process.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/process.c Tue May 11 15:15:48 2004 +0000 +++ b/src/process.c Tue May 11 15:16:10 2004 +0000 @@ -4894,6 +4894,8 @@ } 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 @@ } } 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);