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

Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer
Date: 2010-10-20 19:34:06
Message-ID: 4CBF442E.3060301@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 20.10.2010 18:44, Marti Raudsepp wrote:
> Hi pgsql-hackers,
>
> Currently contrib/pgcrypto/pgp-pubenc.c contains code like:
>
> uint8 algo = pk->algo;
> if (pk == NULL)
> ...
>
> However, if pk was NULL, then the if() condition would never be
> reached because the pk->algo dereference would segfault.
>
> This patch moves the dereference to below the condition which was the
> intended behavior.

Thanks, applied. Did coccicheck find anything else interesting?

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2010-10-20 19:39:09
Subject: Re: PostgreSQL and HugePage
Previous:From: Alvaro HerreraDate: 2010-10-20 19:33:12
Subject: Re: Review: Fix snapshot taking inconsistencies

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