From: Rob Richards Date: Mon, 26 Jan 2009 19:10:09 +0000 (+0000) Subject: fix bug #47220 (segfault in dom_document_parser in recovery mode) X-Git-Tag: php-5.4.0alpha1~191^2~4381 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aba50265bb8c1368da9e8d82e1931eeced1613ea;p=php fix bug #47220 (segfault in dom_document_parser in recovery mode) --- diff --git a/ext/dom/document.c b/ext/dom/document.c index 686506ffd3..df5e1d400d 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1627,7 +1627,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 {