php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32719 strval() fails to zero terminate strings
Submitted: 2005-04-15 15:49 UTC Modified: 2005-04-16 00:46 UTC
From: jason at amp-design dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-04-15 (dev) OS: CentOS 3
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: jason at amp-design dot net
New email:
PHP Version: OS:

 

 [2005-04-15 15:49 UTC] jason at amp-design dot net
Description:
------------
strval() does not terminate strings with 0 / NULL characters. The direct return value for var_dump() is totally garbled. When this result is passed to another internal PHP function this returns random garabe that varies with each request.

Reproduce code:
---------------
<?php
var_dump(strval ('en')); die();
?>

Expected result:
----------------
string(2) "

Actual result:
--------------
string(2) "

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-15 15:51 UTC] jason at amp-design dot net
Sorry, for some reason the 

Expected result:
----------------
string(2) "

Actual result:
--------------
string(2) "

stuff is all wrong.....


string(2) "�^" Warning: String is not zero-terminated (ZZZZ�̏*�̏*ZZZZ) (source: /root/php/php5-200504121430/Zend/zend_variables.h:35) in /var/www/vhosts/martinco.com/httpdocs/phpinfo.php on line 2

is the result I get.

I expect 

string(2) "en"

Sorry about that
 [2005-04-16 00:46 UTC] sniper@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-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 17:01:29 2024 UTC