]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix ex_data and session_dup issues
authorTodd Short <tshort@akamai.com>
Wed, 26 Apr 2017 18:05:49 +0000 (14:05 -0400)
committerRich Salz <rsalz@openssl.org>
Fri, 2 Jun 2017 16:11:38 +0000 (12:11 -0400)
commit1ee2125922d3302e3ea738442bf2b051a445cac0
tree0259c6728f45fd4d836777787dbc4aa9ae23e814
parent01dfaa08b1960049f91485f2e5eec6c6bd03db39
Fix ex_data and session_dup issues

Code was added in commit b3c31a65 that overwrote the last ex_data value
using CRYPTO_dup_ex_data() causing a memory leak, and potentially
confusing the ex_data dup() callback.

In ssl_session_dup(), fix error handling (properly reference and up-ref
shared data) and new-up the ex_data before calling CRYPTO_dup_ex_data();
all other structures that dup ex_data have the destination ex_data new'd
before the dup.

Fix up some of the ex_data documentation.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3323)
crypto/ex_data.c
doc/man3/CRYPTO_get_ex_new_index.pod
ssl/ssl_sess.c
test/exdatatest.c