pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined 6+ messages / 1 participants [nested] [flat]
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/7d64419f8073dafdb8ae28c20b1323bf6a93c55e Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 11 ++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e33a4fda00279ebf68f3ce635fbffa2e1a5db670 Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/63aa4342da23156e612a81c96c7634e49f534bc3 Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5f46c617e95f882cb977940f895dab8734c2d75b Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0b0041b942f7ecca56efec4cb882caec0247984f Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined @ 2026-03-13 07:07 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2026-03-13 07:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org xml2: Fix failure with xslt_process() under -fsanitize=undefined The logic of xslt_process() has never considered the fact that xsltSaveResultToString() would return NULL for an empty string (the upstream code has always done so, with a string length of 0). This would cause memcpy() to be called with a NULL pointer, something forbidden by POSIX. Like 46ab07ffda9d and similar fixes, this is backpatched down to all the supported branches, with a test case to cover this scenario. An empty string has been always returned in xml2 in this case, based on the history of the module, so this is an old issue. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://postgr.es/m/c516a0d9-4406-47e3-9087-5ca5176ebcf9@gmail.com Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/70f7c5badcc069560993faabc744466804446246 Modified Files -------------- contrib/xml2/expected/xml2.out | 10 ++++++++++ contrib/xml2/expected/xml2_1.out | 6 ++++++ contrib/xml2/sql/xml2.sql | 6 ++++++ contrib/xml2/xslt_proc.c | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-03-13 07:07 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz> 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz> 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz> 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz> 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz> 2026-03-13 07:07 pgsql: xml2: Fix failure with xslt_process() under -fsanitize=undefined Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox