From f289d37532ee84f10819d557d6e5047bbabd0d9f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 19 Feb 2009 04:24:54 +0000 Subject: [PATCH] (detect_coding): Don't overflow coding->carryover. --- src/ChangeLog | 1 + src/coding.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ffe4722902d..097cd2812d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,7 @@ 2009-02-19 Kenichi Handa * coding.c (detect_coding): Preserve coding->mode. + Don't overflow coding->carryover. 2009-02-18 Dan Nicolaescu 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) 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++; -- 2.39.5