php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11630 no check for bound of a string
Submitted: 2001-06-23 13:19 UTC Modified: 2001-06-27 11:41 UTC
From: Xuefer at 21cn dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.5 OS: win2k
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Xuefer at 21cn dot com
New email:
PHP Version: OS:

 

 [2001-06-23 13:19 UTC] Xuefer at 21cn dot com
array:
$foo = array("bar");
echo $foo[0]; // correct
echo $foo[1]; // warnning

string?:
$foo = "bar"; // 0-b 1-a 3-r
echo $foo[0]; // correct
echo $foo[4]; // no warnning?


safe:
$foo = "bar"; // 0-b 1-a 3-r
echo $foo;    // all rignts
$foo[1] = "";

crash in win2k:
$foo = "bar"; // 0-b 1-a 3-r
echo $foo[0];
echo $foo[4]; // no warnning
$foo[1] = $foo[4]; // no warnning
echo $foo;    // crash! memory cannot be "written"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-23 14:37 UTC] sniper@php.net
The crash (your last example) should be fixed in CVS.

But I also think there should be a warning at least when
trying to access characters out of the string boundary.

 [2001-06-27 11:41 UTC] zeev@php.net
Fixed
Warnings added in case of a reference to an illegal offset.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 22:01:32 2024 UTC