pgsql: Avoid potential pfree on NULL on OpenSSL errors

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема pgsql: Avoid potential pfree on NULL on OpenSSL errors
Дата
Msg-id E1qjcQb-005HXg-NX@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid potential pfree on NULL on OpenSSL errors

Guard against the pointer being NULL before pfreeing upon an error
returned from OpenSSL.  Also handle errors from X509_NAME_print_ex
which can return -1 on memory allocation errors.

Backpatch down to v15 where the code was added.

Author: Sergey Shinderuk <s.shinderuk@postgrespro.ru>
Discussion: https://postgr.es/m/8db5374d-32e0-6abb-d402-40762511eff2@postgrespro.ru
Backpatch-through: v15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f3aa309a880bb429c6a648d64e20fbd353fee8a

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Simplify information schema check constraint deparsing
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: pgsql: Avoid potential pfree on NULL on OpenSSL errors