postgresql/contrib/xml2
Michael Paquier 9d33a5a804 xml2: Fix crash with namespace nodes in xpath_nodeset()
pgxmlNodeSetToText() passed nodeTab[i]->doc to xmlNodeDump() without
checking the node type, which could cause a crash as a
XML_NAMESPACE_DECL maps to a xmlNs struct.  The passed-in code would
then be dereferenced in xmlNodeDump().

This commit switches the code to render XML_NAMESPACE_DECL nodes with
xmlXPathCastNodeToString(), like xpath_table().  Some tests are added,
written by me.

Author: Andrey Chernyy <andrey.cherny@tantorlabs.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/20260611031436.5afde3cb@andrnote
Backpatch-through: 14
2026-06-11 14:29:18 +09:00
..
expected xml2: Fix crash with namespace nodes in xpath_nodeset() 2026-06-11 14:29:18 +09:00
sql xml2: Fix crash with namespace nodes in xpath_nodeset() 2026-06-11 14:29:18 +09:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile contrib/xml2: Use SQL-standard function bodies. 2024-12-29 13:53:00 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
xml2--1.0--1.1.sql Update xml2 extension for parallel query. 2016-06-14 15:49:32 -04:00
xml2--1.1--1.2.sql contrib/xml2: Use SQL-standard function bodies. 2024-12-29 13:53:00 -05:00
xml2--1.1.sql Update xml2 extension for parallel query. 2016-06-14 15:49:32 -04:00
xml2.control contrib/xml2: Use SQL-standard function bodies. 2024-12-29 13:53:00 -05:00
xpath.c xml2: Fix crash with namespace nodes in xpath_nodeset() 2026-06-11 14:29:18 +09:00
xslt_proc.c xml2: Fix stylesheet document leak in xslt_process() 2026-06-05 14:29:27 +09:00