1 --- libxml2-2.10.0/xmlIO.c.orig 2022-08-18 16:29:32.843322082 +0200
2 +++ libxml2-2.10.0/xmlIO.c 2022-08-18 16:32:12.985787850 +0200
3 @@ -1115,8 +1115,33 @@ xmlGzfileOpen_real (const char *filename
7 - if (!xmlCheckFilename(path))
9 + if (!xmlCheckFilename(path)) {
10 + /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
11 + * append .gz only if filename doesn't alreay end with .gz. */
12 + if (strlen(path) < 3 || strcmp(path + strlen(path) - 3, ".gz") != 0) {
13 + char *gz_filename = xmlMalloc(strlen(path) + 4);
15 + if (gz_filename == NULL) {
16 + xmlGenericError(xmlGenericErrorContext,
17 + "xmlGzfileOpen: %s\n",
18 + "Failure allocating buffer for filename.");
22 + strcpy(gz_filename, path);
23 + strcat(gz_filename, ".gz");
27 + if (xmlCheckFilename(gz_filename))
28 + fd = gzopen(gz_filename, "rb");
30 + xmlFree(gz_filename);
32 + return((void *) fd);
38 fd = xmlWrapGzOpenUtf8(path, "rb");