]> git.eshelyaron.com Git - emacs.git/commitdiff
(CCL_WRITE_CHAR): Fix overflow checking.
authorKenichi Handa <handa@m17n.org>
Fri, 1 Feb 2008 00:38:48 +0000 (00:38 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 1 Feb 2008 00:38:48 +0000 (00:38 +0000)
(CCL_WRITE_MULTIBYTE_CHAR): Likewise.

src/ChangeLog
src/ccl.c

index bef208cc3f99ca0e7210ffd2582c334b1f7b75f2..54678a2dccf94cf704027573eca81825687161f9 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>
+
+       * ccl.c (CCL_WRITE_CHAR): Fix overflow checking.
+       (CCL_WRITE_MULTIBYTE_CHAR): Likewise.
+
 2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>
 
        * keyboard.c (make_ctrl_char): If C is a multibyte character, just
index 59bd6a8e17f430dc228e662e8442ccb101a6801f..f0c078228df18bf47b1dac487e7d4d4fad1c0f49 100644 (file)
--- 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);                               \