[PATCH] pgcrypto: Test for NULL before dereferencing pointer

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема [PATCH] pgcrypto: Test for NULL before dereferencing pointer
Дата
Msg-id AANLkTi=RiA-uvZfkxRQ5=9-duTM8FnQ_Sf4iUX071VqX@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] pgcrypto: Test for NULL before dereferencing pointer  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Creation of temporary tables on read-only standby servers
Следующее
От: Aidan Van Dyk
Дата:
Сообщение: Re: pg_rawdump