PHP :: Bug #71882 :: Negative ftruncate() on php://memory exhausts memory
| Bug #71882 | Negative ftruncate() on php://memory exhausts memory | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2016-03-22 20:26 UTC | Modified: | 2016-08-29 15:57 UTC |
|
||||||||||
| From: | miloslav dot hula at gmail dot com | Assigned: | cmb (profile) | |||||||||||
| Status: | Closed | Package: | Streams related | |||||||||||
| PHP Version: | Irrelevant | OS: | ||||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2016-03-22 20:26 UTC] miloslav dot hula at gmail dot com
Description: ------------ Calling ftruncate() with negative index on php://memory leads to memory exhaustion and fatal error. https://3v4l.org/k720s Test script: --------------- <?php $fd = fopen("php://memory", "w+"); ftruncate($fd, -1); Expected result: ---------------- (nothing) Actual result: -------------- Fatal error: Out of memory (allocated 2097152) (tried to allocate 18446744073709551615 bytes) in /in/k720s on line 4 mmap() failed: [22] Invalid argument mmap() failed: [22] Invalid argument Process exited with code 255.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2016-06-21 21:10 UTC] cmb@php.net
-Status: Open +Status: Verified
[2016-08-12 13:00 UTC] totszwai at gmail dot com
[2016-08-29 15:55 UTC] cmb@php.net
[2016-08-29 15:57 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
[2016-08-30 00:30 UTC] cmb@php.net
-Status: Verified +Status: Closed