php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49273 setcookie() segfaults the php process when adding a positive expires value
Submitted: 2009-08-16 16:58 UTC Modified: 2013-02-18 00:58 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: moisadoru at gmail dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 6SVN-2009-08-16 (snap) OS: Ubuntu linux 9.10alpha3 64bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 + 13 = ?
Subscribe to this entry?

 
 [2009-08-16 16:58 UTC] moisadoru at gmail dot com
Description:
------------
When setting a cookie with setcookie(), if the expires parameter is a positive integer, the PHP child process segfaults.

Environment; Apache 2.2.12, PHP 6.0-200908152030, Ubuntu 9.10 alpha3 linux kernel 2.6.31 64bit.



Reproduce code:
---------------
<?php

    header('Set-Cookie: cookie1=foo1; expires=Sun, 16-Aug-2009 16:39:00 GMT; secure; HttpOnly', TRUE, 200); // works
    setcookie('cookie2', 'foo2',); // works
    setcookie('cookie3', 'foo3', -3600); // works
    setcookie('cookie4', 'foo4', 3600); // segfaults

    echo '<pre>';
    print_r($_COOKIE);
?>


Expected result:
----------------
$_COOKIE array dumped to screen

Actual result:
--------------
Apache error log:
[Sun Aug 16 19:06:38 2009] [notice] child pid 22565 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-16 18:00 UTC] moisadoru at gmail dot com
This bug is also present in the latest SVN (r287372)
 [2011-07-03 04:22 UTC] geissert@php.net
-Status: Open +Status: Feedback
 [2011-07-03 04:22 UTC] geissert@php.net
Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-02-18 00:58 UTC] moisadoru at gmail dot com
-Status: No Feedback +Status: Closed
 [2013-02-18 00:58 UTC] moisadoru at gmail dot com
No longer reproducible. Bug fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 17:01:30 2024 UTC