Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

Next:From: Martijn van OosterhoutDate: 2006-04-19 14:38:17
Subject: Re: bug in windows xp
Previous:From: Tom LaneDate: 2006-04-19 14:15:54
Subject: Re: bug in windows xp

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group