Commit d029549c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by Hiroshi Mimaki

Fix UTF-8 boundary check; ref #4982

parent 6e13467c
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment