]> granicus.if.org Git - php/commitdiff
fix segfault if xpath expression string is invalid
authorRob Richards <rrichards@php.net>
Sun, 5 Oct 2003 13:14:21 +0000 (13:14 +0000)
committerRob Richards <rrichards@php.net>
Sun, 5 Oct 2003 13:14:21 +0000 (13:14 +0000)
ext/dom/xpath.c

index 90fcda2e64a23150b6752c87401af84d7a737929..0bc17ad57f2a0faed247f1ce166ad9627f585cae 100644 (file)
@@ -197,6 +197,9 @@ PHP_FUNCTION(dom_xpath_query)
                ctxp->nsNr = 0;
        }
 
+       if (! xpathobjp) {
+               RETURN_FALSE;
+       }
        if (xpathobjp->type ==  XPATH_NODESET) {
                int i;
                xmlNodeSetPtr nodesetp;