diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-04-28 11:59:20 +0900 |
|---|---|---|
| committer | Hiroshi Mimaki <[email protected]> | 2020-05-01 16:53:25 +0900 |
| commit | d029549c2fb7d6b67bad68b6cf04fa8662e73418 (patch) | |
| tree | 8dcc5aafe187f442948c87c14d2fe147bfa92f48 | |
| parent | 6e13467ce8d59334639045a710ddd93193d643e5 (diff) | |
| download | mruby-d029549c2fb7d6b67bad68b6cf04fa8662e73418.tar.gz mruby-d029549c2fb7d6b67bad68b6cf04fa8662e73418.zip | |
Fix UTF-8 boundary check; ref #4982
| -rw-r--r-- | src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c index 9ea19d107..2ef1ad95a 100644 --- a/src/string.c +++ b/src/string.c @@ -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); |
