com php-src: Sync fix for bug #72910 with current upstream: ext/mbstring/oniguruma/enc/utf8.c
| From: | Stanislav Malyshev | Date: | Mon, 05 Sep 2016 02:13:48 +0000 |
| Subject: | com php-src: Sync fix for bug #72910 with current upstream: ext/mbstring/oniguruma/enc/utf8.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94293@lists.php.net to get a copy of this message | ||
Commit: d1fbc98ff644ead86262497af2febc8ccb6bf401
Author: Stanislav Malyshev <stas@php.net> Sun, 4 Sep 2016 19:13:22 -0700
Parents: b7259b71b430ed733441261f7cf1282f04bb80f1
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1fbc98ff644ead86262497af2febc8ccb6bf401
Log:
Sync fix for bug #72910 with current upstream
Bugs:
https://bugs.php.net/72910
Changed paths:
M ext/mbstring/oniguruma/enc/utf8.c
Diff:
diff --git a/ext/mbstring/oniguruma/enc/utf8.c b/ext/mbstring/oniguruma/enc/utf8.c
index 74122e1...9e8478f 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--) {