diff options
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | ext/mbstring/php_mbregex.c | 3 | ||||
-rw-r--r-- | ext/mbstring/tests/bug77514.phpt | 11 |
3 files changed, 18 insertions, 3 deletions
@@ -1,10 +1,15 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 7.3.3 --Core: + +- Core: . Fixed bug #77494 (Disabling class causes segfault on member access). (Dmitry) +- Mbstring: + . Fixed bug #77514 (mb_ereg_replace() with trailing backslash adds null byte). + (Nikita) + - Opcache: . Fixed bug #77287 (Opcache literal compaction is incompatible with EXT opcodes). (Nikita) diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index cc96e04f39..319ee567c6 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -713,8 +713,7 @@ static inline void mb_regex_substitute( sp = p; /* save position */ clen = (int) php_mb_mbchar_bytes_ex(++p, enc); if (clen != 1 || p == eos) { - /* skip escaped multibyte char */ - p += clen; + /* skip backslash followed by multibyte char */ smart_str_appendl(pbuf, sp, p - sp); continue; } diff --git a/ext/mbstring/tests/bug77514.phpt b/ext/mbstring/tests/bug77514.phpt new file mode 100644 index 0000000000..efcbea24d7 --- /dev/null +++ b/ext/mbstring/tests/bug77514.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #77514: mb_ereg_replace() with trailing backslash adds null byte +--FILE-- +<?php + +$a="abc123"; +var_dump(mb_ereg_replace("123","def\\",$a)); + +?> +--EXPECT-- +string(7) "abcdef\" |