Bug 1209541 - Leak of memory or pointers to system resources in NSS_CMSSignerInfo_Verify, r=ekr,mt
authorTim Taubert <tim@timtaubert.de>
Tue, 29 Sep 2015 10:01:49 -0700
changeset 11619 330c554488726b9f562d21928391cd25131ce8e0
parent 11618 ad20cefe55312044c88a3574c6afea78c749f091
child 11620 3a2530b1882ef0d394e0b404d9f8638918aee086
push id778
push usermartin.thomson@gmail.com
push dateTue, 29 Sep 2015 17:02:45 +0000
reviewersekr, mt
bugs1209541
Bug 1209541 - Leak of memory or pointers to system resources in NSS_CMSSignerInfo_Verify, r=ekr,mt
lib/smime/cmssiginfo.c
--- a/lib/smime/cmssiginfo.c
+++ b/lib/smime/cmssiginfo.c
@@ -399,16 +399,17 @@ NSS_CMSSignerInfo_Verify(NSSCMSSignerInf
 	 * order
 	 */
 	encoded_attrs.data = NULL;
 	encoded_attrs.len = 0;
 
 	if (NSS_CMSAttributeArray_Encode(poolp, &(signerinfo->authAttr), 
 	                                 &encoded_attrs) == NULL ||
 		encoded_attrs.data == NULL || encoded_attrs.len == 0) {
+	    PORT_FreeArena(poolp, PR_FALSE);
 	    vs = NSSCMSVS_ProcessingError;
 	    goto loser;
 	}
 
 	vs = (VFY_VerifyDataDirect(encoded_attrs.data, encoded_attrs.len,
 		publickey, &(signerinfo->encDigest), pubkAlgTag,
 		digestalgtag, NULL, signerinfo->cmsg->pwfn_arg) != SECSuccess) 
 		? NSSCMSVS_BadSignature : NSSCMSVS_GoodSignature;