Replace memset with OPENSSL_clear_free()
authorMatt Caswell <matt@openssl.org>
Thu, 30 Apr 2015 13:04:30 +0000 (14:04 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 10 Jun 2015 09:09:57 +0000 (10:09 +0100)
commit5d80fab086fe8849222613e20d7cf61839f94f5f
tree7b1e769100a70cee5dd63c9bef8a5eda0ec679f0
parente36c5fc4f547ce62280e5a704d1f94189742ec65
Replace memset with OPENSSL_clear_free()

BUF_MEM_free() attempts to cleanse memory using memset immediately prior
to a free. This is at risk of being optimised away by the compiler, so
replace with a call to OPENSSL_clear_free() instead.

With thanks to the Open Crypto Audit Project for reporting this issue.

Reviewed-by: Stephen Henson <steve@openssl.org>
crypto/buffer/buffer.c