summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-09-04 19:13:22 -0700
committerFerenc Kovacs <tyra3l@gmail.com>2016-09-15 09:55:26 +0200
commitb570c506815212c7702bfb0046e87d541e171eb7 (patch)
treecb381eb921dfcb34cd073c1b3a2e553466759cc2
parent1d978b7899f460207826fd9d9707604d69cd1f11 (diff)
downloadphp-git-b570c506815212c7702bfb0046e87d541e171eb7.tar.gz
Sync fix for bug #72910 with current upstream
-rw-r--r--ext/mbstring/oniguruma/enc/utf8.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/mbstring/oniguruma/enc/utf8.c b/ext/mbstring/oniguruma/enc/utf8.c
index 74122e14bf..9e8478ffc6 100644
--- a/ext/mbstring/oniguruma/enc/utf8.c
+++ b/ext/mbstring/oniguruma/enc/utf8.c
@@ -91,14 +91,16 @@ is_mbc_newline(const UChar* p, const UChar* end)
}
static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED)
+mbc_to_code(const UChar* p, const UChar* end)
{
int c, len;
OnigCodePoint n;
- len = enclen(ONIG_ENCODING_UTF8, p);
+ len = mbc_enc_len(p);
+ if (len > end - p) len = end - p;
+
c = *p++;
- if (len > 1 && p < end) {
+ if (len > 1) {
len--;
n = c & ((1 << (6 - len)) - 1);
while (len--) {