Skip to content

Commit c4a5af2

Browse files
committed
fix segfault when node is NULL
1 parent 6fab69a commit c4a5af2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/simplexml/simplexml.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{
10991099
if (sxe->iter.type == SXE_ITER_ELEMENT) {
11001100
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
11011101
}
1102-
if (node->type != XML_ENTITY_DECL) {
1102+
if (!node || node->type != XML_ENTITY_DECL) {
11031103
attr = node ? (xmlAttrPtr)node->properties : NULL;
11041104
zattr = NULL;
11051105
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;

0 commit comments

Comments
 (0)