1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix null pointer dereferences in case of allocation failure

Closes GH-12506.
This commit is contained in:
icy17
2023-10-24 16:09:40 +08:00
committed by Niels Dossche
parent aa45df4849
commit 900f0cab9f
4 changed files with 16 additions and 0 deletions

View File

@@ -110,6 +110,9 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
int isFileUri = 0;
uri = xmlCreateURI();
if (uri == NULL) {
return NULL;
}
escsource = xmlURIEscapeStr((xmlChar *)source, (xmlChar *) ":");
xmlParseURIReference(uri, (char *)escsource);
xmlFree(escsource);