]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 1 Apr 2022 06:49:22 +0000 (19:49 +1300)
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 bbd2715a9e9eb8b2a221055ed958e24443c4aa86..8de2752b5cdb218f19d052aa71523b8086103c69 100644 (file)
@@ -91,7 +91,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);