]> git.ipfire.org Git - thirdparty/openssl.git/commit - ssl/statem/statem_srvr.c
Fix potential double-free
authorTodd Short <tshort@akamai.com>
Fri, 13 Aug 2021 13:59:59 +0000 (09:59 -0400)
committerTomas Mraz <tomas@openssl.org>
Mon, 16 Aug 2021 10:56:53 +0000 (12:56 +0200)
commit0449702abc95a3af24c049cb02c01ca6a8015cef
treeefe0e774486b1164e2421d332316919386dd4cbd
parent0ec738433e522c96c7edfe4c9ffdc76d4dfef00a
Fix potential double-free

The `sk` variable is assigned to `s->session->peer_chain`.
If `ssl3_digest_cached_records()` were to fail, then `sk` would still be
non-NULL, and subsequently freed on the error return. When the session
is freed, it will then attempt to free `s->session->peer_chain`,
resulting in a double-free (of `sk`).

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16309)
ssl/statem/statem_srvr.c