aboutsummaryrefslogtreecommitdiff
path: root/contrib/xml2/xslt_proc.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-01-26 10:15:32 +0900
committerMichael Paquier <michael@paquier.xyz>2024-01-26 10:15:32 +0900
commitf2743a7d70e7b2891277632121bb51e739743a47 (patch)
tree795a8bef9c48060d83f8a24d2424573befdb3026 /contrib/xml2/xslt_proc.c
parent376c216138c75e161d39767650ea30536f23b482 (diff)
downloadpostgresql-f2743a7d70e7b2891277632121bb51e739743a47.tar.gz
postgresql-f2743a7d70e7b2891277632121bb51e739743a47.zip
Revert "Add support for parsing of large XML data (>= 10MB)"
This reverts commit 2197d06224a1, following a discussion over a Coverity report where issues like the "Billion laugh attack" could cause the backend to waste CPU and memory even if a client applied checks on the size of the data given in input, and libxml2 does not offer guarantees that input limits are respected under XML_PARSE_HUGE. Discussion: https://postgr.es/m/ZbHlgrPLtBZyr_QW@paquier.xyz
Diffstat (limited to 'contrib/xml2/xslt_proc.c')
-rw-r--r--contrib/xml2/xslt_proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c
index 9cbc05db1ab..f30a3a42c03 100644
--- a/contrib/xml2/xslt_proc.c
+++ b/contrib/xml2/xslt_proc.c
@@ -87,7 +87,7 @@ xslt_process(PG_FUNCTION_ARGS)
/* Parse document */
doctree = xmlReadMemory((char *) VARDATA_ANY(doct),
VARSIZE_ANY_EXHDR(doct), NULL, NULL,
- XML_PARSE_HUGE | XML_PARSE_NOENT);
+ XML_PARSE_NOENT);
if (doctree == NULL)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,
@@ -96,7 +96,7 @@ xslt_process(PG_FUNCTION_ARGS)
/* Same for stylesheet */
ssdoc = xmlReadMemory((char *) VARDATA_ANY(ssheet),
VARSIZE_ANY_EXHDR(ssheet), NULL, NULL,
- XML_PARSE_HUGE | XML_PARSE_NOENT);
+ XML_PARSE_NOENT);
if (ssdoc == NULL)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,