Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Valdez <svaldez@google.com>2016-03-22 18:14:22 +0300
committerDavid Benjamin <davidben@google.com>2016-03-22 18:17:32 +0300
commitc087c332f89b86b7fc6768e461c97a5ef24b1670 (patch)
tree7a70c1fee150149f779692dfa3f998eaec8fa344 /crypto/digest
parentbe1224882962b63b716ef717377db75f0a805de5 (diff)
Fix potential double free in EVP_DigestInit_ex
There is a potential double free in EVP_DigestInit_ex. This is believed to be reached only as a result of programmer error - but we should fix it anyway. (Imported from upstream's e78dc7e279ed98e1ab9845a70d14dafdfdc88f58) Change-Id: I1da7be7db7afcbe9f30f168df000d64ed73d7edd Reviewed-on: https://boringssl-review.googlesource.com/7541 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/digest')
-rw-r--r--crypto/digest/digest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/digest/digest.c b/crypto/digest/digest.c
index eb71b073..f47cd0a9 100644
--- a/crypto/digest/digest.c
+++ b/crypto/digest/digest.c
@@ -166,6 +166,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) {
if (ctx->digest != type) {
if (ctx->digest && ctx->digest->ctx_size > 0) {
OPENSSL_free(ctx->md_data);
+ ctx->md_data = NULL;
}
ctx->digest = type;
if (type->ctx_size > 0) {