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

From: cca5507 <cca5507(at)qq(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, maralist86 <maralist86(at)mail(dot)ru>
Subject: Re: BUG #18943: Return value of a function 'xmlBufferCreate' isdereferenced at xpath.c:177 without checking for NUL
Date: 2026-03-08 15:05:32
Message-ID: tencent_51B1563E654EA6188FF240C8CE2434B6B005@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> It seems that there are 2 misuse of "volatile" in xml.c:
>
> 1) xmltext()
>
> volatile xmlChar *xmlbuf = NULL; // -> xmlChar *volatile xmlbuf = NULL;
>
> 2) xml_xmlnodetoxmltype()
>
> volatile xmlChar *str = NULL; // -> xmlChar *volatile str = NULL;
>
> We want the pointer itself be volatile rather than what it points to.

Attach a small patch.

--
Regards,
ChangAo Chen

Attachment Content-Type Size
Fix-misuse-of-volatile.patch application/octet-stream 1.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2026-03-08 17:58:30 Re: BUG #19426: pgdump is stuck
Previous Message cca5507 2026-03-08 14:12:09 Re: BUG #18943: Return value of a function 'xmlBufferCreate' isdereferenced at xpath.c:177 without checking for NUL