Re: BUG #18943: Return value of a function 'xmlBufferCreate' is dereferenced at xpath.c:177 without checking for NUL

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-bugs@lists.postgresql.org, maralist86@mail.ru
Date: 2025-07-01T06:49:09Z
Lists: pgsql-bugs
On Mon, Jun 09, 2025 at 07:27:56AM +0900, Michael Paquier wrote:
> I've made similar choices in the past around the same time in the
> release cycle not backpatching stuff that was an issue in backbranches
> still minimal enough to not have to worry about, like 84e4570da923
> (there are a few others).

While doing a secondary review of all that, I have noticed one call to
pg_xml_done() missing at the end of xpath_string().  The rest was
pretty clean.  I have split the changes into two parts for clarity,
and applied each one of them separately: one for xml.c and one for the
contrib module xml2/.
--
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. xml2: Fix failure with xslt_process() under -fsanitize=undefined

  2. Fix misuse of "volatile" in xml.c

  3. xml2: Improve error handling of libxml2 calls

  4. Improve error handling of libxml2 calls in xml.c