[前][次][番号順一覧][スレッド一覧]

ruby-changes:42017

From: nobu <ko1@a...>
Date: Sat, 12 Mar 2016 10:35:59 +0900 (JST)
Subject: [ruby-changes:42017] nobu:r54091 (trunk): unicode.c: off-by-one error

nobu	2016-03-12 10:35:54 +0900 (Sat, 12 Mar 2016)

  New Revision: 54091

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54091

  Log:
    unicode.c: off-by-one error
    
    * enc/unicode.c (CodePointListValidP): fix off-by-one error.

  Modified files:
    trunk/enc/unicode.c
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 54090)
+++ enc/unicode.c	(revision 54091)
@@ -431,7 +431,7 @@ onigenc_unicode_apply_all_case_fold(Onig https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L431
   return 0;
 }
 
-#define CodePointListValidP(x) (OnigCodePointCount((x)->n) < numberof((x)->code))
+#define CodePointListValidP(x) (OnigCodePointCount((x)->n) <= numberof((x)->code))
 
 extern int
 onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]