# HG changeset patch # User Kenichi Handa # Date 1201826306 0 # Node ID 88528794e364ec0e5e891bfbaf9acc5d9a4b3c9c # Parent 8c0a8321e0a378874e3d287bd1d2169f20666b92 (CCL_WRITE_CHAR): Fix overflow checking. (CCL_WRITE_MULTIBYTE_CHAR): Likewise. diff -r 8c0a8321e0a3 -r 88528794e364 src/ccl.c --- a/src/ccl.c Fri Feb 01 00:14:53 2008 +0000 +++ b/src/ccl.c Fri Feb 01 00:38:26 2008 +0000 @@ -748,7 +748,7 @@ 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 @@ 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); \