]> git.ipfire.org Git - thirdparty/openssl.git/commit - ssl/tls_srp.c
Use memset to clear SRP_CTX instead of NULL and zero assignments
authorDiego Santa Cruz <Diego.SantaCruz@spinetix.com>
Tue, 16 May 2017 08:35:49 +0000 (10:35 +0200)
committerMatt Caswell <matt@openssl.org>
Thu, 8 Jun 2017 19:59:24 +0000 (20:59 +0100)
commit135976b3dd24e674c202c20b5746fc04ebb1fc1a
tree0460536c5d200a0cdb663647b63a0b17e40d371d
parente655f5494100d93307726b23f4718ead0cadc0c3
Use memset to clear SRP_CTX instead of NULL and zero assignments

This uses memset() to clear all of the SRP_CTX when free'ing or
initializing it as well as in error paths instead of having a series
of NULL and zero assignments as it is safer.

It also changes SSL_SRP_CTX_init() to reset all the SRP_CTX to zero
in case or error, previously it could retain pointers to freed
memory, potentially leading to a double free.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3467)
ssl/tls_srp.c