]> granicus.if.org Git - onig/commitdiff
fix to add pointer range check previous right_adjust_char_head()
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 5 Oct 2018 07:29:19 +0000 (16:29 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 5 Oct 2018 07:29:19 +0000 (16:29 +0900)
src/regexec.c

index 38861c2d438024978e8b7b2d50ba4a19ca251ed5..c1f19a4b1001c2b5c714a8e13858d5ff830f4341 100644 (file)
@@ -4234,7 +4234,8 @@ sunday_quick_search_case_fold(regex_t* reg,
 #else
     /* This is faster than prev code for long text.  ex: /(?i)Twain/  */
     s += skip;
-    s = onigenc_get_right_adjust_char_head(enc, text, s);
+    if (s < end)
+      s = onigenc_get_right_adjust_char_head(enc, text, s);
 #endif
   }