@@ -462,7 +462,7 @@ static void fetch_zval_from_symbol_table(
462462 if (xdebug_lib_has_active_object ()) {
463463 ZVAL_COPY (& tmp_retval , xdebug_lib_get_active_object ());
464464 } else {
465- ZVAL_NULL (& tmp_retval );
465+ ZVAL_UNDEF (& tmp_retval );
466466 }
467467 goto cleanup ;
468468 }
@@ -495,40 +495,44 @@ static void fetch_zval_from_symbol_table(
495495 XDEBUG_BREAK_INTENTIONALLY_MISSING
496496
497497 case XF_ST_OBJ_PROPERTY :
498+ /* If we don't have an object, bail out */
499+ if (!value_in || Z_TYPE_P (value_in ) != IS_OBJECT ) {
500+ ZVAL_UNDEF (& tmp_retval );
501+ goto cleanup ;
502+ }
503+
498504 /* Let's see if there is a debug handler */
499- if (value_in && Z_TYPE_P (value_in ) == IS_OBJECT ) {
500- myht = xdebug_objdebug_pp (& value_in , XDEBUG_VAR_OBJDEBUG_DEFAULT );
505+ myht = xdebug_objdebug_pp (& value_in , XDEBUG_VAR_OBJDEBUG_DEFAULT );
501506
502- if (myht ) {
503- /* As a normal (public) property */
504- zval * tmp = zend_symtable_str_find (myht , name , name_length );
505- if (tmp != NULL ) {
507+ if (myht ) {
508+ /* As a normal (public) property */
509+ zval * tmp = zend_symtable_str_find (myht , name , name_length );
510+ if (tmp != NULL ) {
506511#if PHP_VERSION_ID >= 80400
507- if (Z_TYPE_P (tmp ) == IS_PTR ) {
508- zend_release_properties (myht );
509- goto skip_for_property_hook ;
510- }
511- #endif
512- ZVAL_COPY (& tmp_retval , tmp );
512+ if (Z_TYPE_P (tmp ) == IS_PTR ) {
513513 zend_release_properties (myht );
514- goto cleanup ;
514+ goto skip_for_property_hook ;
515515 }
516+ #endif
517+ ZVAL_COPY (& tmp_retval , tmp );
518+ zend_release_properties (myht );
519+ goto cleanup ;
520+ }
516521
517- /* As a private property */
518- {
519- char * unmangled = replace_star_by_null (name , name_length );
520- zval * tmp = zend_symtable_str_find (myht , unmangled , name_length );
521- if (tmp != NULL ) {
522- ZVAL_COPY (& tmp_retval , tmp );
523- zend_release_properties (myht );
524- xdfree (unmangled );
525- goto cleanup ;
526- }
522+ /* As a private property */
523+ {
524+ char * unmangled = replace_star_by_null (name , name_length );
525+ zval * tmp = zend_symtable_str_find (myht , unmangled , name_length );
526+ if (tmp != NULL ) {
527+ ZVAL_COPY (& tmp_retval , tmp );
528+ zend_release_properties (myht );
527529 xdfree (unmangled );
530+ goto cleanup ;
528531 }
529-
530- zend_release_properties (myht );
532+ xdfree (unmangled );
531533 }
534+
535+ zend_release_properties (myht );
532536 }
533537
534538#if PHP_VERSION_ID >= 80400
0 commit comments