-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.4: Fix GH-16477 (Segmentation fault when calling __debugInfo() after failed SplFileObject::__constructor) Fix GH-16477 (Segmentation fault when calling __debugInfo() after failed SplFileObject::__constructor) Fix GH-16477 (Segmentation fault when calling __debugInfo() after failed SplFileObject::__constructor)
- Loading branch information
Showing
3 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
GH-16477-2: Memory leak when calling SplTempFileObject::__constructor() twice | ||
--FILE-- | ||
<?php | ||
|
||
$obj = new SplTempFileObject(); | ||
|
||
try { | ||
$obj->__construct(); | ||
} catch (Throwable $e) { | ||
echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
} | ||
$obj->__debugInfo(); | ||
|
||
?> | ||
DONE | ||
--EXPECT-- | ||
Error: Cannot call constructor twice | ||
DONE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
GH-16477: Segmentation fault when calling __debugInfo() after failed SplFileObject::__constructor | ||
--FILE-- | ||
<?php | ||
|
||
$obj = new SplFileObject(__FILE__); | ||
|
||
try { | ||
$obj->__construct(); | ||
} catch (Throwable $e) { | ||
echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
} | ||
$obj->__debugInfo(); | ||
|
||
?> | ||
DONE | ||
--EXPECT-- | ||
ArgumentCountError: SplFileObject::__construct() expects at least 1 argument, 0 given | ||
DONE |