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

From Marti Raudsepp
Subject [PATCH] pgcrypto: Test for NULL before dereferencing pointer
Date
Msg-id AANLkTi=RiA-uvZfkxRQ5=9-duTM8FnQ_Sf4iUX071VqX@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Creation of temporary tables on read-only standby servers
Next
From: Aidan Van Dyk
Date:
Subject: Re: pg_rawdump