diff options
| author | Kim F. Storm | 2004-05-11 15:16:10 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-05-11 15:16:10 +0000 |
| commit | d7d2483aede7611f85d6f578394a49b85acdefec (patch) | |
| tree | 8a0c2e206ff43e902a46b95ab05cf7dffc620731 /src/process.c | |
| parent | b47e779e527ebbca34c3798f1a4a00dad4626346 (diff) | |
| download | emacs-d7d2483aede7611f85d6f578394a49b85acdefec.tar.gz emacs-d7d2483aede7611f85d6f578394a49b85acdefec.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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 868143bd12e..bbfc06c3082 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4894,6 +4894,8 @@ read_process_output (proc, channel) | |||
| 4894 | } | 4894 | } |
| 4895 | 4895 | ||
| 4896 | carryover = nbytes - coding->consumed; | 4896 | carryover = nbytes - coding->consumed; |
| 4897 | if (SCHARS (p->decoding_buf) < carryover) | ||
| 4898 | p->decoding_buf = make_uninit_string (carryover); | ||
| 4897 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), | 4899 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), |
| 4898 | carryover); | 4900 | carryover); |
| 4899 | XSETINT (p->decoding_carryover, carryover); | 4901 | XSETINT (p->decoding_carryover, carryover); |
| @@ -4998,6 +5000,8 @@ read_process_output (proc, channel) | |||
| 4998 | } | 5000 | } |
| 4999 | } | 5001 | } |
| 5000 | carryover = nbytes - coding->consumed; | 5002 | carryover = nbytes - coding->consumed; |
| 5003 | if (SCHARS (p->decoding_buf) < carryover) | ||
| 5004 | p->decoding_buf = make_uninit_string (carryover); | ||
| 5001 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), | 5005 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), |
| 5002 | carryover); | 5006 | carryover); |
| 5003 | XSETINT (p->decoding_carryover, carryover); | 5007 | XSETINT (p->decoding_carryover, carryover); |