diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-01-06 01:39:24 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-01-06 01:39:24 +0000 |
commit | ad65ce755ea292df565a50e730e4210a3e732f4e (patch) | |
tree | 3935dd7109ea178fb4d9e6b5061ab51cffaa08ba /crypto/asn1/x_pubkey.c | |
parent | e416ad9772df448635e91bb6153bf811aede13b3 (diff) |
Fix things so DH_free() will be no-op when passed NULL, like RSA_free() and
DSA_free(): this was causing crashes when for example an attempt was made
to handle a (currently) unsupported DH public key. Also X509_PUBKEY_set()i
wasn't checking errors from d2i_PublicKey().
Diffstat (limited to 'crypto/asn1/x_pubkey.c')
-rw-r--r-- | crypto/asn1/x_pubkey.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index a70f53fe6f..2177ebd6ed 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -183,7 +183,7 @@ EVP_PKEY *pkey; goto err; } - i=i2d_PublicKey(pkey,NULL); + if ((i=i2d_PublicKey(pkey,NULL)) <= 0) goto err; if ((s=(unsigned char *)Malloc(i+1)) == NULL) goto err; p=s; i2d_PublicKey(pkey,&p); |