php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40941 Segfault with Reflection and undeclared class properties
Submitted: 2007-03-29 05:15 UTC Modified: 2007-03-30 00:32 UTC
From: daniel dot oconnor at gmail dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.2.1 OS: Ubuntu (fiesty)
Private report: No CVE-ID: None
 [2007-03-29 05:15 UTC] daniel dot oconnor at gmail dot com
Description:
------------
Segfaults happen when you put something into a class property you haven't declared.

Probably a dupe of 40460, 40431; but affecting 5.2.1

Reproduce code:
---------------
<?php
class Example {
    public function segfault() {
        $class = new ReflectionObject($this);
        $properties = $class->getProperties();

        foreach ($properties as $property) {
            //Kaboom!
            if ($property->isStatic()) { continue; }
        }
        return true;
    }

    public function __construct($jr_id = null) {
        $this->d = "";
    }

}
$report = new Example();
$report->segfault();


Expected result:
----------------
No segfault.
Warnings about undeclared stuff.

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-29 08:14 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-03-30 00:32 UTC] daniel dot oconnor at gmail dot com
Works For Me, CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 10:01:33 2024 UTC