]> git.eshelyaron.com Git - emacs.git/commitdiff
(detect_coding): Don't overflow coding->carryover.
authorKenichi Handa <handa@m17n.org>
Thu, 19 Feb 2009 04:24:54 +0000 (04:24 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 19 Feb 2009 04:24:54 +0000 (04:24 +0000)
src/ChangeLog
src/coding.c

index ffe4722902da949aa146a5007e0b75f911189352..097cd2812d1cd24d1a1ca9c0581593661102cf91 100644 (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>
 
index ec57467f0230bf1b3cd5ba3d262b2755069fadac..313e4021486ef023f0c08b1fdb86fea68bc264f9 100644 (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++;