Re: Two coverity non-bugs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Two coverity non-bugs
Date: 2006-04-19 14:32:21
Message-ID: 25867.1145457141@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> Attached is a patch that fixes two non-bugs. There's plenty of
> redundant NULL checks around the place but these were just so silly I
> figure they're worth fixing.

> The first checks 'file' the line after having dereferenced it. The
> second checks 'currSchema' where the code is designed to never allow it
> to be NULL.

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 ...)

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-04-19 14:38:17 Re: bug in windows xp
Previous Message Tom Lane 2006-04-19 14:15:54 Re: bug in windows xp