Skip to content

Commit 3c98c2d

Browse files
committed
Fixed bug #77514
1 parent d460e06 commit 3c98c2d

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

NEWS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.3.3
4-
-Core:
4+
5+
- Core:
56
. Fixed bug #77494 (Disabling class causes segfault on member access).
67
(Dmitry)
78

9+
- Mbstring:
10+
. Fixed bug #77514 (mb_ereg_replace() with trailing backslash adds null byte).
11+
(Nikita)
12+
813
- Opcache:
914
. Fixed bug #77287 (Opcache literal compaction is incompatible with EXT
1015
opcodes). (Nikita)

ext/mbstring/php_mbregex.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,7 @@ static inline void mb_regex_substitute(
713713
sp = p; /* save position */
714714
clen = (int) php_mb_mbchar_bytes_ex(++p, enc);
715715
if (clen != 1 || p == eos) {
716-
/* skip escaped multibyte char */
717-
p += clen;
716+
/* skip backslash followed by multibyte char */
718717
smart_str_appendl(pbuf, sp, p - sp);
719718
continue;
720719
}

ext/mbstring/tests/bug77514.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #77514: mb_ereg_replace() with trailing backslash adds null byte
3+
--FILE--
4+
<?php
5+
6+
$a="abc123";
7+
var_dump(mb_ereg_replace("123","def\\",$a));
8+
9+
?>
10+
--EXPECT--
11+
string(7) "abcdef\"

0 commit comments

Comments
 (0)