Bug #11630 Updated: no check for bound of a string

From: Date: Sat, 23 Jun 2001 18:37:29 +0000
Subject: Bug #11630 Updated: no check for bound of a string
Groups: php.dev 
Request: Send a blank email to php-dev+get-57774@lists.php.net to get a copy of this message
ID: 11630 Updated by: sniper Reported By: Xuefer@21cn.com Old-Status: Open Status: Analyzed Old-Bug Type: Strings related Bug Type: Scripting Engine problem Operating system: PHP Version: 4.0.5 Assigned To: Comments: 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. Previous Comments: --------------------------------------------------------------------------- [2001-06-23 13:19:42] Xuefer@21cn.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" --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11630&edit=2

« previous php.dev (#57774) next »