Skip to content

Commit

Permalink
MFH: fix bug #47220 (segfault in dom_document_parser in recovery mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Richards committed Jan 26, 2009
1 parent 51f4e5e commit cbdb8f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/dom/document.c
Expand Up @@ -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 {
Expand Down

0 comments on commit cbdb8f6

Please sign in to comment.