Richard Levitte - VMS Whacker wrote:

OpenSSL version 0.9.8 Beta 1

There is still an old bugfix about some potential memory leaks in crypto/pkcs7/pk7_smime.c that I sent last year.

New version of patch attached...

Bye

Goetz

--
DMCA: The greed of the few outweighs the freedom of the many
Index: crypto/pkcs7/pk7_smime.c
===================================================================
RCS file: /cvs/openssl/openssl/crypto/pkcs7/pk7_smime.c,v
retrieving revision 1.24
diff -u -r1.24 pk7_smime.c
--- crypto/pkcs7/pk7_smime.c	17 May 2005 05:52:24 -0000	1.24
+++ crypto/pkcs7/pk7_smime.c	19 May 2005 21:10:39 -0000
@@ -88,6 +88,7 @@
 
     	if (!(si = PKCS7_add_signature(p7,signcert,pkey,EVP_sha1()))) {
 		PKCS7err(PKCS7_F_PKCS7_SIGN,PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR);
+		PKCS7_free(p7);
 		return NULL;
 	}
 
@@ -105,6 +106,7 @@
 		{
 		if(!(smcap = sk_X509_ALGOR_new_null())) {
 			PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
+			PKCS7_free(p7);
 			return NULL;
 		}
 #ifndef OPENSSL_NO_DES
@@ -130,6 +132,7 @@
 
 	if (!(p7bio = PKCS7_dataInit(p7, NULL))) {
 		PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
+		PKCS7_free(p7);
 		return NULL;
 	}
 
@@ -139,10 +142,12 @@
 
         if (!PKCS7_dataFinal(p7,p7bio)) {
 		PKCS7err(PKCS7_F_PKCS7_SIGN,PKCS7_R_PKCS7_DATASIGN);
+		PKCS7_free(p7);
+		BIO_free_all(p7bio);
 		return NULL;
 	}
 
-        BIO_free_all(p7bio);
+	BIO_free_all(p7bio);
 	return p7;
 }
 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Reply via email to