diff options
author | 2014-04-22 20:38:02 +0000 | |
---|---|---|
committer | 2014-04-22 20:38:02 +0000 | |
commit | c2edc8a61d856209e57de53f3faa68b40da8ddeb (patch) | |
tree | eb67f4c77d88ed16ad610d6e3f65454a69b26b04 | |
parent | Remove files which look like actual code compiled in libcrypto, but isn't. (diff) | |
download | wireguard-openbsd-c2edc8a61d856209e57de53f3faa68b40da8ddeb.tar.xz wireguard-openbsd-c2edc8a61d856209e57de53f3faa68b40da8ddeb.zip |
null a pointer to prevent double free. from Dirk Engling
-rw-r--r-- | lib/libcrypto/asn1/a_bytes.c | 1 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/a_bytes.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/libcrypto/asn1/a_bytes.c b/lib/libcrypto/asn1/a_bytes.c index 34ed7b7db2b..6cc774e7828 100644 --- a/lib/libcrypto/asn1/a_bytes.c +++ b/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/lib/libssl/src/crypto/asn1/a_bytes.c b/lib/libssl/src/crypto/asn1/a_bytes.c index 34ed7b7db2b..6cc774e7828 100644 --- a/lib/libssl/src/crypto/asn1/a_bytes.c +++ b/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; |