[openssl-commits] [openssl] master update
Dr. Stephen Henson
steve at openssl.org
Thu Apr 21 23:00:21 UTC 2016
The branch master has been updated
via 2ac7753c107e71bfdcaa08b18eb4e6683292be57 (commit)
from e38bd9489aa2c7d87105f388027ba5a84c9949f9 (commit)
- Log -----------------------------------------------------------------
commit 2ac7753c107e71bfdcaa08b18eb4e6683292be57
Author: Dr. Stephen Henson <steve at openssl.org>
Date: Thu Apr 21 15:30:17 2016 +0100
Fix CRYPTO_clear_realloc() bug.
If allocation in CRYPTO_clear_realloc() fails don't free up the original
buffer: this is consistent with the behaviour of realloc(3) and is expected
in other places in OpenSSL.
Reviewed-by: Rich Salz <rsalz at openssl.org>
Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/mem.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/crypto/mem.c b/crypto/mem.c
index 16ef64c..9bdd504 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -201,9 +201,10 @@ void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
}
ret = CRYPTO_malloc(num, file, line);
- if (ret)
+ if (ret != NULL) {
memcpy(ret, str, old_len);
- CRYPTO_clear_free(str, old_len, file, line);
+ CRYPTO_clear_free(str, old_len, file, line);
+ }
return ret;
}
More information about the openssl-commits
mailing list