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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 02:01:28 2025 UTC