xmlBufferCreate return value not checked in pgxmlNodeSetToText - Mailing list pgsql-hackers

From Oleg Tselebrovskiy
Subject xmlBufferCreate return value not checked in pgxmlNodeSetToText
Date
Msg-id 8e74efeb8af43caba7a9c6478e969d24@postgrespro.ru
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Why is subscription/t/031_column_list.pl failing so much?
Next
From: Michael Paquier
Date:
Subject: Re: Returning non-terminated string in ECPG Informix-compatible function