php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13999 Invalid array initialization will crash Apache !?
Submitted: 2001-11-09 13:22 UTC Modified: 2001-11-09 14:06 UTC
From: g dot noel at symphonieonline dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: Apache - Linux / Windows
Private report: No CVE-ID: None
 [2001-11-09 13:22 UTC] g dot noel at symphonieonline dot com
This code will crash apache :

<?php
$a = '';
$i = 'TEST';
if (!isset($a['BUG'][$i])) {
    $a['BUG'][$i] = 'SAMPLE';
}
?>

But not this one :

<?php
$a = '';
$i = 'TEST';
$a['BUG'][$i] = 'SAMPLE';
?>

Nor this one :

<?php
$a = array();
$i = 'TEST';
if (!isset($a['BUG'][$i])) {
    $a['BUG'][$i] = 'SAMPLE';
}
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-09 14:06 UTC] cardinal@php.net
Reproduced in 4.0.6, but looks like it's fixed in 4.1.0 RC1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 18:01:31 2024 UTC