xmlBufferCreate return value not checked in pgxmlNodeSetToText

From: Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: xmlBufferCreate return value not checked in pgxmlNodeSetToText
Date: 2024-02-15 05:18:33
Message-ID: 8e74efeb8af43caba7a9c6478e969d24@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings, everyone!

While analyzing output of Svace static analyzer [1] I've found a bug.

In function pgxmlNodeSetToText there is a call of xmlBufferCreate that
doesn't
have its return value checked. In all four other calls of
xmlBufferCreate there
is a try...catch that checks the return value inside.

I suggest to add the same checks here that are used in other four calls
of
xmlBufferCreate.

The proposed patch is attached.

[1] - https://svace.pages.ispras.ru/svace-website/en/

Oleg Tselebrovskiy, Postgres Pro

Attachment Content-Type Size
pgxmlNodeSetToText_fix.patch text/x-diff 3.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-02-15 05:25:07 Re: Returning non-terminated string in ECPG Informix-compatible function
Previous Message vignesh C 2024-02-15 05:16:11 Re: Why is subscription/t/031_column_list.pl failing so much?