Bug #62653 [Opn]: unset(array($foo)) crashes apache depending on $foo

From: Date: Wed, 25 Jul 2012 13:40:44 +0000
Subject: Bug #62653 [Opn]: unset(array($foo)) crashes apache depending on $foo
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172229@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62653&edit=1 ID: 62653 Updated by: laruence@php.net Reported by: davidso1 at rose-hulman dot edu Summary: unset(array($foo)) crashes apache depending on $foo Status: Open Type: Bug Package: Apache2 related Operating System: Windows Server PHP Version: 5.4.5 Block user comment: N Private report: N New Comment: I can no reproduce this on Linux redhat Previous Comments: ------------------------------------------------------------------------ [2012-07-24 19:27:22] sixd@php.net The testcase produces invalid reads & writes in valgrind. ------------------------------------------------------------------------ [2012-07-24 16:16:05] davidso1 at rose-hulman dot edu Description: ------------ The test code crashes apache in the 5.4+ environment. $foo starts as a string, gets interpreted as a double but it isn't I guess. unset($array[(double) $foo]) works as expected Test script: --------------- $array = array("5"=>"bar"); $foo = "10.0000"; // gettype($foo) = "string" $foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double" unset($array[$foo]); print_r($array); Expected result: ---------------- Array() Actual result: -------------- Error 101 (net::ERR_CONNECTION_RESET): The connection was reset. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62653&edit=1

« previous php.bugs (#172229) next »