Bug 1132818 - Fix -Wsometimes-uninitialized nsresult warning in security/nss/lib/smime/smimeutil.c, r=kaie
authorChris Peterson <cpeterson@mozilla.com>
Sat, 21 Feb 2015 00:26:22 +0100
changeset 11361 10c82beac9148ffb064d927e0e65df1ffe14b01c
parent 11360 ac277ab60e8fd2dec952bc139c15b631c089d558
child 11362 aba37bd9510caef883ef9e8249411c998cec54d7
push id563
push userkaie@kuix.de
push dateFri, 20 Feb 2015 23:26:30 +0000
reviewerskaie
bugs1132818
Bug 1132818 - Fix -Wsometimes-uninitialized nsresult warning in security/nss/lib/smime/smimeutil.c, r=kaie
lib/smime/smimeutil.c
--- a/lib/smime/smimeutil.c
+++ b/lib/smime/smimeutil.c
@@ -432,20 +432,22 @@ smime_choose_cipher(CERTCertificate *sce
 	     * XXX This is probably only good for RSA keys.  What I would
 	     * really like is a function to just say;  Is the public key in
 	     * this cert an export-length key?  Then I would not have to
 	     * know things like the value 512, or the kind of key, or what
 	     * a subjectPublicKeyInfo is, etc.
 	     */
 	    key = CERT_ExtractPublicKey(rcerts[rcount]);
 	    pklen_bits = 0;
+	    key_type = nullKey;
 	    if (key != NULL) {
 		pklen_bits = SECKEY_PublicKeyStrengthInBits (key);
 		key_type = SECKEY_GetPublicKeyType(key);
 		SECKEY_DestroyPublicKey (key);
+		key = NULL;
 	    }
 
 	    if (key_type == ecKey) {
 		/* While RFC 5753 mandates support for AES-128 CBC, should use
 		 * AES 256 if user's key provides more than 128 bits of
 		 * security strength so that symmetric key is not weak link. */
 
 		/* RC2-40 is not compatible with elliptic curve keys. */