php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44722 The save_path cannot contain NULL characters
Submitted: 2008-04-14 16:20 UTC Modified: 2008-04-15 00:33 UTC
From: antphill at uk dot ibm dot com Assigned:
Status: Closed Package: Session related
PHP Version: 6CVS-2008-04-14 (snap) OS: SUSE Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: antphill at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2008-04-14 16:20 UTC] antphill at uk dot ibm dot com
Description:
------------
Calling session_save_path() with no arguments produces a warning: "The save_path cannot contain NULL characters" and returns FALSE instead of an empty string. This only reproduces on Linux, on Windows the test passes as expected.

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

ob_start();
echo "*** Testing session_save_path() : error functionality ***\n";

$directory = dirname(__FILE__);
var_dump(session_save_path());
var_dump(session_save_path($directory));
var_dump(session_save_path());

echo "Done";
ob_end_flush();
?>


Expected result:
----------------
--EXPECTF--
*** Testing session_save_path() : error functionality ***
string(0) ""
string(0) ""
string(%d) "%s"
Done
--UEXPECTF--
*** Testing session_save_path() : error functionality ***
unicode(0) ""
unicode(0) ""
unicode(%d) "%s"
Done

Actual result:
--------------
*** Testing session_save_path() : error functionality ***

Warning: session_save_path(): The save_path cannot contain NULL characters. in /mnt/hgfs/Projects/Session/php-6.0/session_save_path_basic.php on line 14
bool(false)
string(0) ""
string(34) "/mnt/hgfs/Projects/Session/php-6.0"
Done


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-14 16:22 UTC] antphill at uk dot ibm dot com
Forgot to ssay, this happens with both unicode semantics enabled and disabled.
 [2008-04-14 16:27 UTC] antphill at uk dot ibm dot com
In fact just this script causes the segmentation fault:

<?php
var_dump(session_save_path());
?>

Note I have no php.ini actually being used, just the default settings!
 [2008-04-15 00:33 UTC] scottmac@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 03 15:00:01 2025 UTC