|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-27 09:43 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ If cookie value is NULL, http_build_cookies() tries to allocate too much memory for some reason. HTTP extension version is 1.6.6. I can reproduce this with PHP versions 5.2.8 and 5.3.1 on Ubuntu, but not in 5.2.12 on FreeBSD. Passing cookie value through strval() helps. Reproduce code: --------------- var_dump(http_build_cookie(array( 'cookies' => array( 'empty' => null, ), ))); Expected result: ---------------- $ php -f test-cookies.php string(8) "empty=; " Actual result: -------------- $ php -f test-cookies.php Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 441559261 bytes) in .../test-cookies.php on line 7