diff options
author | 2015-02-14 15:11:22 +0000 | |
---|---|---|
committer | 2015-02-14 15:11:22 +0000 | |
commit | 3fca064f64cad18afe88f77423bd9aa987d486f0 (patch) | |
tree | 58e5e16516df330ec5bfb3ca1940b19dccb546fc /lib/libssl/src | |
parent | Check for allocation error in RSA_eay_mod_exp(). Coverity CID 25217. (diff) | |
download | wireguard-openbsd-3fca064f64cad18afe88f77423bd9aa987d486f0.tar.xz wireguard-openbsd-3fca064f64cad18afe88f77423bd9aa987d486f0.zip |
Coverity CID 21733 (unchecked allocation), 78823 (leak on error).
ok doug@ jsing@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r-- | lib/libssl/src/crypto/dsa/dsa_ameth.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa_ameth.c b/lib/libssl/src/crypto/dsa/dsa_ameth.c index d4c8b111a88..b9ee49f0559 100644 --- a/lib/libssl/src/crypto/dsa/dsa_ameth.c +++ b/lib/libssl/src/crypto/dsa/dsa_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_ameth.c,v 1.16 2015/02/11 04:05:14 beck Exp $ */ +/* $OpenBSD: dsa_ameth.c,v 1.17 2015/02/14 15:11:22 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -143,9 +143,14 @@ dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) ASN1_STRING *str; str = ASN1_STRING_new(); + if (str == NULL) { + DSAerr(DSA_F_DSA_PUB_ENCODE, ERR_R_MALLOC_FAILURE); + goto err; + } str->length = i2d_DSAparams(dsa, &str->data); if (str->length <= 0) { DSAerr(DSA_F_DSA_PUB_ENCODE, ERR_R_MALLOC_FAILURE); + ASN1_STRING_free(str); goto err; } pval = str; |