php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24345 php get Seg. fault when use out of range array element.
Submitted: 2003-06-26 08:48 UTC Modified: 2003-06-26 12:04 UTC
From: legion at altlinux dot ru Assigned: iliaa (profile)
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.3RC1 OS: ALTLinux (2.4.21rc1)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-06-26 08:48 UTC] legion at altlinux dot ru
Description:
------------
php get seg. fault if i try to use none exists array element. 
Php version: PHP 4.3.3RC2-dev (cvs snapshot 20030624)


Reproduce code:
---------------
<?
$s = "a|b|c|d";
for ($i = 0; $i < 1000; $i++) {
   for ($j = 0; $j < 1000; $j++) {
    $a = split("\|", $s);
    $h[$i]['date'][$j]['count'] = $a[4];
   }
}
?>

Expected result:
----------------
Successfully finished.

Actual result:
--------------
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-26 09:02 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

This is fixed in PHP-5.0.0-dev and can not be backported to PHP 4.3.3-dev due to limitations in the engine.
 [2003-06-26 10:50 UTC] iliaa@php.net
There maybe a solution for this bug for 4.X, however it needs testing. Once it has been validated or rejected final decision about the status of this bug will be made.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC