pgsql: Avoid regression in the size of XML input that we will accept.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid regression in the size of XML input that we will accept.
Date: 2025-07-28 20:51:02
Message-ID: E1ugUoI-001CRB-1R@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid regression in the size of XML input that we will accept.

This mostly reverts commit 6082b3d5d, "Use xmlParseInNodeContext
not xmlParseBalancedChunkMemory". It turns out that
xmlParseInNodeContext will reject text chunks exceeding 10MB, while
(in most libxml2 versions) xmlParseBalancedChunkMemory will not.
The bleeding-edge libxml2 bug that we needed to work around a year
ago is presumably no longer a factor, and the argument that
xmlParseBalancedChunkMemory is semi-deprecated is not enough to
justify a functionality regression. Hence, go back to doing it
the old way.

Reported-by: Michael Paquier <michael(at)paquier(dot)xyz>
Author: Michael Paquier <michael(at)paquier(dot)xyz>
Co-authored-by: Erik Wienhold <ewie(at)ewie(dot)name>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/aIGknLuc8b8ega2X@paquier.xyz
Backpatch-through: 13

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/637ead2e1aa1fe955f9f095f791a38ef7797c959

Modified Files
--------------
src/backend/utils/adt/xml.c | 68 ++++++++++++++++++++-------------------------
1 file changed, 30 insertions(+), 38 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2025-07-29 03:18:25 pgsql: Display Memoize planner estimates in EXPLAIN
Previous Message Robert Haas 2025-07-28 15:17:55 pgsql: Remove misleading hint for "unexpected data beyond EOF" error.