Re: Two coverity non-bugs - Mailing list pgsql-patches

From Martijn van Oosterhout
Subject Re: Two coverity non-bugs
Date
Msg-id 20060419144807.GK15420@svana.org
Whole thread Raw
In response to Re: Two coverity non-bugs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Two coverity non-bugs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Wed, Apr 19, 2006 at 10:32:21AM -0400, Tom Lane wrote:
> The first patch looks reasonable but I object to the second.  Coverity
> is not going to dictate coding conventions to us --- it is not *nearly*
> bright enough for that.  In this case, the code is locally allowing for
> the possibility that AH->currSchema was NULL, and I don't consider it
> good style to remove that allowance.  (I take it BTW that this allegedly
> bulletproof tool fails to consider the possibility that strdup fails
> and returns NULL ...)

Sure. These are just high on the scale of silliness. There are many
more that are less silly which I'm just ignoring.

Note, what coverity actually picked up was that in the latter case in
_selectOutputSchema that the free will always execute because if
AH->currSchema was NULL it would have died at the beginning of the
function (line 2205). It's me who misinterpreted the fix. We should
probably be adding checks to all the strdups and to line 2205 instead.

It doesn't directly complain about strdup itself because nowhere does
any code do a strdup and dereference it in the same function.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] bug in windows xp
Next
From: Tom Lane
Date:
Subject: Re: Patch for #2391: "Similar to" pattern matching does not operate as documented