Avoid potential NULL dereference in ssl_set_pkey()
authortb <tb@openbsd.org>
Wed, 31 Aug 2022 06:51:36 +0000 (06:51 +0000)
committertb <tb@openbsd.org>
Wed, 31 Aug 2022 06:51:36 +0000 (06:51 +0000)
commit137b8d492653bc648f60b9636e4a04ea9585df81
treedc986dedd40a5e45180fd612403dc9e8506cc92c
parentf79b181da7b89def34375295533a083d9acebd6d
Avoid potential NULL dereference in ssl_set_pkey()

Switch from X509_get_pubkey() to X509_get0_pubkey() to avoid an unnecessary
EVP_PKEY_free(). Check the return values of X509_get0_pubkey() and
EVP_PKEY_copy_parameters(). If the former returns NULL, the latter will
dereference NULL.

CID 25020

ok jsing
lib/libssl/ssl_rsa.c