]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ESI: Drop incorrect and unnecessary xmlSetFeature() call (#988)
authorNick Wellnhofer <wellnhofer@aevum.de>
Sun, 20 Feb 2022 19:42:40 +0000 (19:42 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 22 Feb 2022 19:45:52 +0000 (19:45 +0000)
xmlSetFeature() has been deprecated for 10+ years and will eventually be
removed from libxml2. Squid calls xmlSetFeature() with the wrong
argument: a nil `value` pointer instead of a pointer to a zero value.
When called with a nil `value`, the function does nothing but returning
an error. Squid does not check whether xmlSetFeature() call is
successful, and the bug went unnoticed since libxml2 support was added
in commit 964b44c.

Since libxml2 does not substitute entities by default, the call can be
removed to achieve the intended effect.

src/esi/Libxml2Parser.cc

index 5d16520f31c73501347aface66d760ee29a1fc24..cd6d3d8e3e6067b59c89ef29a951c53230ea430f 100644 (file)
@@ -118,7 +118,6 @@ ESILibxml2Parser::ESILibxml2Parser(ESIParserClient *aClient) : theClient (aClien
 
     /* TODO: grab the document encoding from the headers */
     parser = xmlCreatePushParserCtxt(&sax, static_cast<void *>(this), NULL, 0, NULL);
-    xmlSetFeature(parser, "substitute entities", 0);
 
     if (entity_doc == NULL)
         entity_doc = htmlNewDoc(NULL, NULL);