From: Kenichi Handa Date: Fri, 1 Feb 2008 00:38:48 +0000 (+0000) Subject: (CCL_WRITE_CHAR): Fix overflow checking. X-Git-Tag: emacs-pretest-22.1.91~108 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0acdaf8df50ab7c7ce9836e1246a4214a00e7c8f;p=emacs.git (CCL_WRITE_CHAR): Fix overflow checking. (CCL_WRITE_MULTIBYTE_CHAR): Likewise. --- diff --git a/src/ChangeLog b/src/ChangeLog index bef208cc3f9..54678a2dccf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-02-01 Kenichi Handa + + * ccl.c (CCL_WRITE_CHAR): Fix overflow checking. + (CCL_WRITE_MULTIBYTE_CHAR): Likewise. + 2008-01-31 Kenichi Handa * keyboard.c (make_ctrl_char): If C is a multibyte character, just diff --git a/src/ccl.c b/src/ccl.c index 59bd6a8e17f..f0c078228df 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -748,7 +748,7 @@ while(0) int bytes = SINGLE_BYTE_CHAR_P (ch) ? 1: CHAR_BYTES (ch); \ if (!dst) \ CCL_INVALID_CMD; \ - else if (dst + bytes + extra_bytes < (dst_bytes ? dst_end : src)) \ + else if (dst + bytes + extra_bytes <= (dst_bytes ? dst_end : src)) \ { \ if (bytes == 1) \ { \ @@ -775,7 +775,7 @@ while(0) int bytes = CHAR_BYTES (ch); \ if (!dst) \ CCL_INVALID_CMD; \ - else if (dst + bytes + extra_bytes < (dst_bytes ? dst_end : src)) \ + else if (dst + bytes + extra_bytes <= (dst_bytes ? dst_end : src)) \ { \ if (CHAR_VALID_P ((ch), 0)) \ dst += CHAR_STRING ((ch), dst); \