aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2009-02-19 04:24:54 +0000
committerKenichi Handa2009-02-19 04:24:54 +0000
commitf289d37532ee84f10819d557d6e5047bbabd0d9f (patch)
tree79052147ae0a1ebc74d5c161aba544995ac4f7fa /src/coding.c
parentb691fa802f95a4474fc9c723efe8feb02d1115d8 (diff)
downloademacs-f289d37532ee84f10819d557d6e5047bbabd0d9f.tar.gz
emacs-f289d37532ee84f10819d557d6e5047bbabd0d9f.zip
(detect_coding): Don't overflow coding->carryover.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index ec57467f023..313e4021486 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6805,6 +6805,8 @@ decode_coding (coding)
6805 coding->carryover. */ 6805 coding->carryover. */
6806 unsigned char *p = coding->carryover; 6806 unsigned char *p = coding->carryover;
6807 6807
6808 if (nbytes > sizeof coding->carryover)
6809 nbytes = sizeof coding->carryover;
6808 coding->carryover_bytes = nbytes; 6810 coding->carryover_bytes = nbytes;
6809 while (nbytes-- > 0) 6811 while (nbytes-- > 0)
6810 *p++ = *src++; 6812 *p++ = *src++;