php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37565 Using reflection::export with simplexml causing a crash
Submitted: 2006-05-23 21:42 UTC Modified: 2006-05-23 22:08 UTC
From: php at trancer dot nl Assigned: helly (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.1.* OS: *
Private report: No CVE-ID: None
 [2006-05-23 21:42 UTC] php at trancer dot nl
Description:
------------
If you try to Reflection::export a simplexml loading that has been loaded using a custom object extended by ReflectionObject PHP will core. 

Reproduce code:
---------------
<?php

class Setting extends ReflectionObject { }

Reflection::export(simplexml_load_string('<test />', "Setting"));

?>

Expected result:
----------------
Unknown.

Actual result:
--------------
Core dump of PHP.

   1.
      #0  _class_string (str=0x7fffffad4380, ce=0xbbff88, obj=0x0, indent=0x7ba1a6 "", tsrm_ls=0x984030)
   2.
          at /home/pierre/cvs/php_5_2/ext/reflection/php_reflection.c:312
   3.
      #1  0x0000000000525610 in zim_reflection_class___toString (ht=Variable "ht" is not available.
   4.
      ) at /home/pierre/cvs/php_5_2/ext/reflection/php_reflection.c:2751
   5.
      #2  0x0000000000668902 in zend_call_function (fci=0x7fffffad4500, fci_cache=Variable "fci_cache" is not available.
   6.
      ) at /home/pierre/cvs/php_5_2/Zend/zend_execute_API.c:945
   7.
      #3  0x0000000000669b7b in call_user_function_ex (function_table=Variable "function_table" is not available.
   8.
      ) at /home/pierre/cvs/php_5_2/Zend/zend_execute_API.c:572
   9.
      #4  0x00000000005260d2 in zim_reflection_export (ht=Variable "ht" is not available.
  10.
      ) at /home/pierre/cvs/php_5_2/ext/reflection/php_reflection.c:1257
  11.
      #5  0x000000000069809e in zend_do_fcall_common_helper_SPEC (execute_data=0x7fffffad47a0, tsrm_ls=0x984030) at zend_vm_execute.h:200
  12.
      #6  0x000000000069758f in execute (op_array=0xbba5c8, tsrm_ls=0x984030) at zend_vm_execute.h:92
  13.
      #7  0x000000000067606f in zend_execute_scripts (type=8, tsrm_ls=0x984030, retval=Variable "retval" is not available.
  14.
      ) at /home/pierre/cvs/php_5_2/Zend/zend.c:1099
  15.
      #8  0x000000000062a759 in php_execute_script (primary_file=0x7fffffad6e90, tsrm_ls=0x984030) at /home/pierre/cvs/php_5_2/main/main.c:1743
  16.
      #9  0x0000000000725c34 in main (argc=2, argv=0x7fffffad7058) at /home/pierre/cvs/php_5_2/sapi/cli/php_cli.c:1093 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-23 22:08 UTC] helly@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in CVS (5.2, HEAD only)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC