summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2014-05-10 11:53:40 -0300
committerFelipe Pena <felipensp@gmail.com>2014-05-10 11:53:40 -0300
commit345f6d90d5947c5cf380db79c1c6366a72cc6e8d (patch)
treeba556ddd9a5eca78e752c8295043f3bbcb2eb28a /ext/simplexml/simplexml.c
parent5bd443a4520a542cd3f86f9d549eca78f693f730 (diff)
downloadphp-git-345f6d90d5947c5cf380db79c1c6366a72cc6e8d.tar.gz
- Fixed missing NULL check in SimpleXMLElement::xpath()
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r--ext/simplexml/simplexml.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 006d6c9491..0f05f52c1c 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1270,6 +1270,9 @@ SXE_METHOD(xpath)
if (!sxe->node) {
php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
}
+ if (!sxe->node) {
+ RETURN_FALSE;
+ }
nodeptr = php_sxe_get_first_node(sxe, sxe->node->node TSRMLS_CC);