From 8e08167934efbcc6e5e2c691e4e173e3bb6176b5 Mon Sep 17 00:00:00 2001 From: tedu <> Date: Tue, 22 Apr 2014 20:38:02 +0000 Subject: null a pointer to prevent double free. from Dirk Engling --- src/lib/libcrypto/asn1/a_bytes.c | 1 + src/lib/libssl/src/crypto/asn1/a_bytes.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c index 34ed7b7db2..6cc774e782 100644 --- a/src/lib/libcrypto/asn1/a_bytes.c +++ b/src/lib/libcrypto/asn1/a_bytes.c @@ -205,6 +205,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, if ((ret->length < len) || (ret->data == NULL)) { if (ret->data != NULL) free(ret->data); + ret->data = NULL; s = malloc(len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; diff --git a/src/lib/libssl/src/crypto/asn1/a_bytes.c b/src/lib/libssl/src/crypto/asn1/a_bytes.c index 34ed7b7db2..6cc774e782 100644 --- a/src/lib/libssl/src/crypto/asn1/a_bytes.c +++ b/src/lib/libssl/src/crypto/asn1/a_bytes.c @@ -205,6 +205,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, if ((ret->length < len) || (ret->data == NULL)) { if (ret->data != NULL) free(ret->data); + ret->data = NULL; s = malloc(len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; -- cgit v1.2.3-55-g6feb