Skip to content

Commit a8ad2cf

Browse files
committed
Merged pull request xdebug#1085
* pr/1085: Fixed issue #2430: Variable fetching may crash with :: if there is no active stack
2 parents 2b5ab61 + b6e82a3 commit a8ad2cf

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/lib/var.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ void xdebug_get_php_symbol(zval *retval, xdebug_str* name)
819819
state = 1;
820820
keyword_end = &ptr[ctr];
821821

822-
if (strncmp(keyword, "::", 2) == 0 && active_fse->function.object_class) { /* static class properties */
822+
if (strncmp(keyword, "::", 2) == 0 && active_fse && active_fse->function.object_class) { /* static class properties */
823823
zend_class_entry *ce = zend_fetch_class(active_fse->function.object_class, ZEND_FETCH_CLASS_SELF);
824824

825825
current_classname = estrdup(STR_NAME_VAL(ce->name));

tests/base/bug02430.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Test for bug #2430: Variable fetching may crash with :: if there is no active stack
3+
--INI--
4+
xdebug.mode=develop
5+
--FILE--
6+
<?php
7+
xdebug_debug_zval(":::");
8+
?>
9+
--EXPECT--
10+
:::: no such symbol

0 commit comments

Comments
 (0)