Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer - Mailing list pgsql-hackers

From Marti Raudsepp
Subject Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer
Date
Msg-id AANLkTi=E75Bp2nWah_soJVwXCSfYYO+WkxApVTMZfapY@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer
List pgsql-hackers
On Wed, Oct 20, 2010 at 22:34, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Did coccicheck find anything else interesting?

There's a file descriptor leak in psql/command.c function
process_file() -- on errors it just returns without closing the file.
But since it's quitting anyway, there's no practical impact. Should I
submit a patch for this as well?

Then there are a few more cases found by null_ref (same check as the
original patch). But on closer inspection, these are false positives,
because the variable is actually modified in between dereferencing and
the NULL check.

Then there's the 'badzero' check that finds a dozen cases where
pointers are compared to a literal 0, not a NULL. This is a only a
coding style check, as far as I can tell, so I thought it's not worth
it.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: WIP: extensible enums
Next
From: Tom Lane
Date:
Subject: Re: Creation of temporary tables on read-only standby servers