(detect_coding): Don't overflow coding->carryover.

This commit is contained in:
Kenichi Handa 2009-02-19 04:24:54 +00:00
parent b691fa802f
commit f289d37532
2 changed files with 3 additions and 0 deletions

View file

@ -5,6 +5,7 @@
2009-02-19 Kenichi Handa <handa@m17n.org>
* coding.c (detect_coding): Preserve coding->mode.
Don't overflow coding->carryover.
2009-02-18 Dan Nicolaescu <dann@ics.uci.edu>

View file

@ -6805,6 +6805,8 @@ decode_coding (coding)
coding->carryover. */
unsigned char *p = coding->carryover;
if (nbytes > sizeof coding->carryover)
nbytes = sizeof coding->carryover;
coding->carryover_bytes = nbytes;
while (nbytes-- > 0)
*p++ = *src++;