Skip to content

Commit fa3c8ee

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix pcre leak test (#21327)
2 parents 56d515a + 4e83123 commit fa3c8ee

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ext/pcre/tests/preg_match_frameless_leak.phpt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Memory leak in preg_match() frameless function with invalid regex and object arg
55
class Str {
66
private $val;
77
public function __construct($val) {
8-
$this->val = $val;
8+
$this->val = str_repeat($val, random_int(1, 1));
99
}
1010
public function __toString() {
1111
return $this->val;
@@ -15,10 +15,7 @@ class Str {
1515
$regex = new Str("invalid regex");
1616
$subject = new Str("some subject");
1717

18-
// Running in a loop to ensure leak detection if run with memory tools
19-
for ($i = 0; $i < 100; $i++) {
20-
@preg_match($regex, $subject);
21-
}
18+
@preg_match($regex, $subject);
2219

2320
echo "Done";
2421
?>

0 commit comments

Comments
 (0)