1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-26 00:37:43 +03:00

parser: Set depth limit to 2048 with XML_PARSE_HUGE

Deeply nested documents can cause performance problems, so the nesting
depth should always be limited to a reasonable value.

Also remove the global xmlParserMaxDepth setting which isn't thread-safe
and seems unused.
This commit is contained in:
Nick Wellnhofer
2024-01-02 17:02:21 +01:00
parent 875bb08489
commit a2cc7f5f04
2 changed files with 28 additions and 21 deletions

View File

@@ -25,11 +25,14 @@ extern "C" {
/**
* xmlParserMaxDepth:
*
* DEPRECATED: has no effect
*
* arbitrary depth limit for the XML documents that we allow to
* process. This is not a limitation of the parser but a safety
* boundary feature, use XML_PARSE_HUGE option to override it.
*/
XMLPUBVAR unsigned int xmlParserMaxDepth;
XML_DEPRECATED
XMLPUBVAR const unsigned int xmlParserMaxDepth;
/**
* XML_MAX_TEXT_LENGTH: