diff --git a/CHANGES b/CHANGES index d4d87ec5cf22875ca0685852b1abf91268ebea81..61be21a2f69047608e3e505121fee945aa8e7354 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes between 0.9.1c and 0.9.2 + *) Make DH_free() tolerate being passed a NULL pointer (like RSA_free() and + DSA_free()). Make X509_PUBKEY_set() check for errors in d2i_PublicKey(). + *) X509_name_add_entry() freed the wrong thing after an error. [Arne Ansper ] @@ -23,7 +26,7 @@ [Ralf S. Engelschall] *) Fix the various library and apps files to free up pkeys obtained from - EVP_PUBKEY_get() et al. Also allow x509.c to handle netscape extensions. + X509_PUBKEY_get() et al. Also allow x509.c to handle netscape extensions. [Steve Henson] *) Fix reference counting in X509_PUBKEY_get(). This makes diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index a70f53fe6fe0987996cd61134d2377b5c5cd7260..2177ebd6ed41e1954f780e4a537abb7c673416cb 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); diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index a83c97287e13109fe5b8c1158bed106c81de20b2..725d99470224a487ae0823643f60f0f35b0827ae 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -88,6 +88,7 @@ DH *DH_new() void DH_free(r) DH *r; { + if(r == NULL) return; if (r->p != NULL) BN_clear_free(r->p); if (r->g != NULL) BN_clear_free(r->g); if (r->pub_key != NULL) BN_clear_free(r->pub_key);