[Groonga-commit] groonga/groonga-normalizer-mysql [master] Do out of range check in used code

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 3 17:02:13 JST 2013


Kouhei Sutou	2013-02-03 17:02:13 +0900 (Sun, 03 Feb 2013)

  New Revision: 781c2df9c9436c4b3f02d184571885cf32075087
  https://github.com/groonga/groonga-normalizer-mysql/commit/781c2df9c9436c4b3f02d184571885cf32075087

  Log:
    Do out of range check in used code

  Modified files:
    normalizers/mysql.c

  Modified: normalizers/mysql.c (+2 -4)
===================================================================
--- normalizers/mysql.c    2013-02-03 10:06:36 +0900 (283811e)
+++ normalizers/mysql.c    2013-02-03 17:02:13 +0900 (9076204)
@@ -1598,9 +1598,6 @@ decompose_character(const char *rest, int character_length,
       ((rest[1] & 0x3f) << 4) +
       ((rest[2]) & 0x3c);
     *low_code = ((rest[1] & 0x03) << 6) + (rest[2] & 0x3f);
-    if (*plane > 0xff) {
-      *plane = -1;
-    }
     break;
   default :
     *plane = -1;
@@ -1655,7 +1652,8 @@ normalize(grn_ctx *ctx, grn_obj *string)
         current_type[-1] |= GRN_CHAR_BLANK;
       }
     } else {
-      if (plane >= 0x00 && mysql_unicode_normalize_table[plane]) {
+      if ((0x00 <= plane && plane <= 0xff) &&
+          mysql_unicode_normalize_table[plane]) {
         uint32_t normalized_code;
         unsigned int n_bytes;
         normalized_code = mysql_unicode_normalize_table[plane][low_code];
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index