Thread: xmlBufferCreate return value not checked in pgxmlNodeSetToText

xmlBufferCreate return value not checked in pgxmlNodeSetToText

From
Oleg Tselebrovskiy
Date:
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