Skip to content

Commit 5b05d42

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Leak in failed unserialize() with opcache
2 parents ef5ca80 + f0baf3d commit 5b05d42

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
OSS-Fuzz #433303828
3+
--FILE--
4+
<?php
5+
6+
unserialize('O:2:"yy": ');
7+
unserialize('O:2:"yy":: ');
8+
9+
?>
10+
--EXPECTF--
11+
Warning: unserialize(): Error at offset 9 of 10 bytes in %s on line %d
12+
13+
Warning: unserialize(): Error at offset 10 of 11 bytes in %s on line %d

ext/standard/var_unserializer.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,10 +1312,12 @@ object ":" uiv ":" ["] {
13121312
YYCURSOR = *p;
13131313

13141314
if (*(YYCURSOR) != ':') {
1315+
zend_string_release_ex(class_name, 0);
13151316
return 0;
13161317
}
13171318
if (*(YYCURSOR+1) != '{') {
13181319
*p = YYCURSOR+1;
1320+
zend_string_release_ex(class_name, 0);
13191321
return 0;
13201322
}
13211323

0 commit comments

Comments
 (0)