Re: BUG #18981: Fault tolerance and improvement for xmltotext_with_options (xml.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: d(dot)kovalenko(at)postgrespro(dot)ru
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18981: Fault tolerance and improvement for xmltotext_with_options (xml.c)
Date: 2025-07-08 16:51:56
Message-ID: 882827.1751993516@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Please look at this code:
> https://github.com/postgres/postgres/blob/a27893df45ec5d8c657899202e9cf0b9a816fe2f/src/backend/utils/adt/xml.c#L730
> xmlerrcxt = pg_xml_init(PG_XML_STRICTNESS_ALL);
> pg_xml_init uses palloc and may "raise an exception".

Yup, we should cover that case.

> Also
> Within PG_CATCH 'doc' is not NULL.

Agreed. Pushed your fix with small editorialization.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2025-07-08 16:53:25 Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Previous Message Fujii Masao 2025-07-08 16:42:00 Re: Unexpected behavior when setting "idle_replication_slot_timeout"