summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-04-22 20:38:02 +0000
committertedu <>2014-04-22 20:38:02 +0000
commitf2c999617d6535f1dd8d5c81930947c671da5d74 (patch)
tree331e5ef376de2ccabebcb550848c02fd7ae7a0f1
parent59ad701696f8717443067248a37beaf3fdb38ad8 (diff)
downloadopenbsd-f2c999617d6535f1dd8d5c81930947c671da5d74.tar.gz
openbsd-f2c999617d6535f1dd8d5c81930947c671da5d74.tar.bz2
openbsd-f2c999617d6535f1dd8d5c81930947c671da5d74.zip
null a pointer to prevent double free. from Dirk Engling
-rw-r--r--src/lib/libcrypto/asn1/a_bytes.c1
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bytes.c1
2 files changed, 2 insertions, 0 deletions
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,
205 if ((ret->length < len) || (ret->data == NULL)) { 205 if ((ret->length < len) || (ret->data == NULL)) {
206 if (ret->data != NULL) 206 if (ret->data != NULL)
207 free(ret->data); 207 free(ret->data);
208 ret->data = NULL;
208 s = malloc(len + 1); 209 s = malloc(len + 1);
209 if (s == NULL) { 210 if (s == NULL) {
210 i = ERR_R_MALLOC_FAILURE; 211 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,
205 if ((ret->length < len) || (ret->data == NULL)) { 205 if ((ret->length < len) || (ret->data == NULL)) {
206 if (ret->data != NULL) 206 if (ret->data != NULL)
207 free(ret->data); 207 free(ret->data);
208 ret->data = NULL;
208 s = malloc(len + 1); 209 s = malloc(len + 1);
209 if (s == NULL) { 210 if (s == NULL) {
210 i = ERR_R_MALLOC_FAILURE; 211 i = ERR_R_MALLOC_FAILURE;