Re: Two coverity non-bugs

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Two coverity non-bugs
Date: 2006-04-19 14:48:07
Message-ID: 20060419144807.GK15420@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-04-19 14:55:25 Re: Patch for #2391: "Similar to" pattern matching does not operate as documented
Previous Message Tom Lane 2006-04-19 14:45:48 Re: bug in windows xp