]> granicus.if.org Git - php/commitdiff
MFH: fix bug #47220 (segfault in dom_document_parser in recovery mode)
authorRob Richards <rrichards@php.net>
Mon, 26 Jan 2009 19:10:53 +0000 (19:10 +0000)
committerRob Richards <rrichards@php.net>
Mon, 26 Jan 2009 19:10:53 +0000 (19:10 +0000)
ext/dom/document.c

index 933ea76a4fee2c6314ed166b3725eafb628295bb..bdb58497b9db3361fdd747d6846307b75166e588 100644 (file)
@@ -1625,7 +1625,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
                        EG(error_reporting) = old_error_reporting;
                }
                /* If loading from memory, set the base reference uri for the document */
-               if (ret->URL == NULL && ctxt->directory != NULL) {
+               if (ret && ret->URL == NULL && ctxt->directory != NULL) {
                        ret->URL = xmlStrdup(ctxt->directory);
                }
        } else {