Skip to content

Commit f0baf3d

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

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ PHP NEWS
3434
- Sockets:
3535
. Fix some potential crashes on incorrect argument value. (nielsdos)
3636

37+
- Standard:
38+
. Fixed OSS Fuzz #417078295 (Leak in failed unserialize() with opcache).
39+
(ilutov)
40+
3741
31 Jul 2025, PHP 8.4.11
3842

3943
- Calendar:
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)