mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix UTF-8 boundary check; ref #4982
This commit is contained in:
+1
-1
@@ -463,7 +463,7 @@ str_index_str_by_char_search(mrb_state *mrb, const char *p, const char *pend, co
|
||||
}
|
||||
|
||||
pivot = p + qstable[(unsigned char)p[slen - 1]];
|
||||
if (pivot > pend || pivot < p /* overflowed */) { return -1; }
|
||||
if (pivot >= pend || pivot < p /* overflowed */) { return -1; }
|
||||
|
||||
do {
|
||||
p += utf8len(p, pend);
|
||||
|
||||
Reference in New Issue
Block a user