summaryrefslogtreecommitdiff
path: root/ext/mbstring
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-09-04 19:15:30 -0700
committerStanislav Malyshev <stas@php.net>2016-09-04 19:15:30 -0700
commitc3dfe57c23cb88e1adb06ce05ef60eacafa86aa3 (patch)
treeafc59078e6a440cc220c5dbe839e8c3eb3eba19e /ext/mbstring
parent7f97d63130b8321af771a0f358a9c0c85704ed99 (diff)
parentd1fbc98ff644ead86262497af2febc8ccb6bf401 (diff)
downloadphp-git-c3dfe57c23cb88e1adb06ce05ef60eacafa86aa3.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: Sync fix for bug #72910 with current upstream
Diffstat (limited to 'ext/mbstring')
-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--) {