[xdebug-dev] Bug 0000183: property_get on $this->undefinedvariable

From: <xdebug-dev[@]lists.xdebug.org>
Date: Sat, 27 May 2006 22:12:30 +0200

The following bug has been CLOSED
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000183
======================================================================
Reporter: Tindu
Handler:
======================================================================
Project: Xdebug
Bug ID: 183
Category: Usage problems
Reproducibility: always
Severity: crash
Priority: normal
Status: closed
Operating System: WIN XP
PHP Version: 5.1.2
Xdebug Version: 2.0.0beta4
======================================================================
Date Submitted: 2006-05-10 11:37 CEST
Last Modified: 2006-05-27 22:12 CEST
======================================================================
Summary: property_get on $this->undefinedvariable
Description:
property_get -n $this->somethingnonexistent crashes the debugger. In source
code:

retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword,
type, current_classname, cc_length TSRMLS_CC);
current_classname = fetch_classname_from_zval(retval, &cc_length
TSRMLS_CC);
if (retval) {
        st = fetch_ht_from_zval(retval TSRMLS_CC);
}
keyword = NULL;

As retval may be nill then fetch_class_name crashes.
If this issue is fixed then for some weird reason
        res = zend_eval_string(eval_string, ret_zval, "xdebug eval" TSRMLS_CC);
crashes in _xdebug_do_eval.
======================================================================

----------------------------------------------------------------------
 derick - 2006-05-10 11:42 CEST
----------------------------------------------------------------------
The code in CVS is:
                            if (keyword) {
                                retval = fetch_zval_from_symbol_table(st,
keyword, keyword_end - keyword, type, current_classname, cc_length T
                         if (retval) {
                                    if (current_classname) {
                                        efree(current_classname);
                                    }
                                    current_classname =
fetch_classname_from_zval(retval, &cc_length TSRMLS_CC);
                                    st = fetch_ht_from_zval(retval
TSRMLS_CC);
                                }
                                keyword = NULL;
                            }

as you can see I only fetch the classname when retval is not NULL.

So please try latest CVS, or the windows binary from
http://pecl4win.php.net/ext.php/php_xdebug.dll

----------------------------------------------------------------------
 derick - 2006-05-27 22:12 CEST
----------------------------------------------------------------------
This should be fixed in CVS by now.

Bug History
Date Modified Username Field Change
======================================================================
2006-05-10 11:37Tindu New Bug
2006-05-10 11:37Tindu Bug Monitored: Tindu
2006-05-10 11:42derick Bugnote Added: 0000406
2006-05-27 22:12derick Bugnote Added: 0000415
2006-05-27 22:12derick Status new => closed
======================================================================
Received on Sat May 27 2006 - 22:12:35 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST