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

[PATCH] pgcrypto: Test for NULL before dereferencing pointer

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] pgcrypto: Test for NULL before dereferencing pointer
Date: 2010-10-20 15:44:40
Message-ID: AANLkTi=RiA-uvZfkxRQ5=9-duTM8FnQ_Sf4iUX071VqX@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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.

Regards,
Marti

Attachment: 0001-pgcrypto-Test-for-NULL-before-dereferencing-pointer.patch
Description: text/x-patch (1.0 KB)

Responses

pgsql-hackers by date

Next:From: Aidan Van DykDate: 2010-10-20 16:10:29
Subject: Re: pg_rawdump
Previous:From: Tom LaneDate: 2010-10-20 15:37:02
Subject: Re: Creation of temporary tables on read-only standby servers

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