Skip to content

Commit fd6874c

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78338: Array cross-border reading in PCRE
2 parents 4adf3dc + 8947fd9 commit fd6874c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ext/pcre/pcre2lib/pcre2_jit_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8538,7 +8538,7 @@ int lgb, rgb, ricount;
85388538
PCRE2_SPTR bptr;
85398539
uint32_t c;
85408540

8541-
GETCHARINC(c, cc);
8541+
c = *cc++;
85428542
#if PCRE2_CODE_UNIT_WIDTH == 32
85438543
if (c >= 0x110000)
85448544
return NULL;

ext/pcre/tests/bug78338.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Bug #78338 (Array cross-border reading in PCRE)
3+
--FILE--
4+
<?php
5+
$string = hex2bin('2f5c583f3d3f223f3536ff3636ffffffff36a8a8a83636367a7a7a7a3d2aff2f0a');
6+
preg_match($string, $string);
7+
echo "DONE\n";
8+
?>
9+
--EXPECT--
10+
DONE

0 commit comments

Comments
 (0)