[PATCH] 4 coverity patches for ECPG

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] 4 coverity patches for ECPG
Date: 2006-04-23 21:55:03
Message-ID: 20060423215503.GC23074@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Here's some patches to clear up some of the most obvious problems with
ECPG. This is just scratching the surface, but it's good to start
somewhere:

- coverity_163.diff

Strange assumption about var. The rest of the code in the function
assumes var will not be NULL, yet this one line does not.

- coverity_170.diff

Assumption that PQresultErrorField will never return NULL.

- coverity_244.diff

The code allows con to be NULL, yet if it is, this line will segfault.

- coverity_252_253.diff

Move the PGTYPESnumeric_free outside the loop to avoid the double free
possibility.

- ecpgtest.patch

A patch which add a "make check" to the ecpg/test directory. I don't
expect this to be committed to CVS, but it's provided as an example of
the tests the above patches pass.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment Content-Type Size
coverity_163.diff text/plain 854 bytes
coverity_170.diff text/plain 694 bytes
coverity_244.diff text/plain 958 bytes
coverity_252_253.diff text/plain 1.0 KB
ecpgtest.patch text/plain 56.2 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-04-23 23:41:16 Re: Building with Visual C++
Previous Message Magnus Hagander 2006-04-23 20:10:54 Building with Visual C++