Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79971: special character is breaking the path in xml function
This commit is contained in:
Stanislav Malyshev 2021-11-14 23:28:13 -08:00
commit ca87d46a3e
No known key found for this signature in database
GPG key ID: 94B3CB48C3ECA219
5 changed files with 63 additions and 0 deletions

View file

@ -303,6 +303,10 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
int isescaped=0;
xmlURI *uri;
if (strstr(filename, "%00")) {
php_error_docref(NULL, E_WARNING, "URI must not contain percent-encoded NUL bytes");
return NULL;
}
uri = xmlParseURI(filename);
if (uri && (uri->scheme == NULL ||
@ -482,6 +486,11 @@ php_libxml_output_buffer_create_filename(const char *URI,
if (URI == NULL)
return(NULL);
if (strstr(URI, "%00")) {
php_error_docref(NULL, E_WARNING, "URI must not contain percent-encoded NUL bytes");
return NULL;
}
puri = xmlParseURI(URI);
if (puri != NULL) {
if (puri->scheme != NULL)