Replace memset with OPENSSL_cleanse()
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:29:31 +0000 (10:29 +0100)
commite94118ae2a6aff6427ade82e843d683d4913bcec
tree413af993c2345fab63f3b95d27217c13ebc8d71d
parent106a9a5d7e26e728a654d7424849081bd988d4a5
Replace memset with OPENSSL_cleanse()

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_cleanse() instead.

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

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