]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid potential pfree on NULL on OpenSSL errors
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 22 Sep 2023 09:18:25 +0000 (11:18 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 22 Sep 2023 09:18:25 +0000 (11:18 +0200)
commit9dc85806d8beb1d4b0cc5461cc3a7d2e44c6e782
treedea6e257a7615174e56336941480a6eec86eeb5d
parent77dc8160278925f453a1b7560326021f971b9b74
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 also 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
src/backend/libpq/be-secure-openssl.c