php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71914 Reference is lost in case
Submitted: 2016-03-29 09:11 UTC Modified: 2016-04-02 17:53 UTC
From: laruence@php.net Assigned: bwoebi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.5 OS:
Private report: No CVE-ID: None
 [2016-03-29 09:11 UTC] laruence@php.net
Description:
------------
thanks for the ssh access by Spritz, reference is lost after case statement.


Test script:
---------------
<?php

function bug(&$value) {
    switch ($value) {
    case "xxxx":
        $value = true;
        break;
    }
}


function test($arr, &$dummy) {
    bug($arr["str"]);
    var_dump($arr);
}


$array = array("str" => "xxxx");
test($array, $array["str"]);

Expected result:
----------------
true

Actual result:
--------------
string(4) "xxxx"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-29 09:15 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2e6d70787c93413daecbea529bf0f74fa901d1db
Log: Fixed bug #71914 (Reference is lost in &quot;switch&quot;)
 [2016-03-29 09:15 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-04-02 17:53 UTC] bwoebi@php.net
-PHP Version: 7.0.4 +PHP Version: 7.0.5 -Assigned To: +Assigned To: bwoebi
 [2016-04-07 16:33 UTC] info at nepda dot eu
When do you publish a new version of PHP (7.0.6!?) with this patch? My code does not work with this bug and I want to use the latest stable version of PHP to be not vulnerable.
 [2016-07-20 11:32 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2e6d70787c93413daecbea529bf0f74fa901d1db
Log: Fixed bug #71914 (Reference is lost in &quot;switch&quot;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 16:01:33 2024 UTC