mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
path handling bug introduced by my recent machinations fixed
This commit is contained in:
12
parser.c
12
parser.c
@ -10342,6 +10342,7 @@ xmlCreateFileParserCtxt(const char *filename)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
xmlParserInputPtr inputStream;
|
||||
char *canonicFilename;
|
||||
char *directory = NULL;
|
||||
|
||||
ctxt = xmlNewParserCtxt();
|
||||
@ -10352,7 +10353,16 @@ xmlCreateFileParserCtxt(const char *filename)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
inputStream = xmlLoadExternalEntity(filename, NULL, ctxt);
|
||||
canonicFilename = xmlCanonicPath(filename);
|
||||
if (canonicFilename == NULL) {
|
||||
if (xmlDefaultSAXHandler.error != NULL) {
|
||||
xmlDefaultSAXHandler.error(NULL, "out of memory\n");
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
inputStream = xmlLoadExternalEntity(canonicFilename, NULL, ctxt);
|
||||
xmlFree(canonicFilename);
|
||||
if (inputStream == NULL) {
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(NULL);
|
||||
|
Reference in New Issue
Block a user