Clear buffer in PEM_write_bio
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 30 Mar 2018 17:13:06 +0000 (19:13 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 19 Apr 2018 13:47:43 +0000 (15:47 +0200)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5814)

crypto/pem/pem_lib.c

index 8300992..6e66e9d 100644 (file)
@@ -661,7 +661,7 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
     if (retval == 0)
         PEMerr(PEM_F_PEM_WRITE_BIO, reason);
     EVP_ENCODE_CTX_free(ctx);
-    OPENSSL_free(buf);
+    OPENSSL_clear_free(buf, PEM_BUFSIZE * 8);
     return retval;
 }