diff options
Diffstat (limited to 'security/nss/lib')
-rw-r--r-- | security/nss/lib/cryptohi/dsautil.c | 5 | ||||
-rw-r--r-- | security/nss/lib/pk11wrap/pk11cert.c | 3 | ||||
-rw-r--r-- | security/nss/lib/smime/cmsrecinfo.c | 3 | ||||
-rw-r--r-- | security/nss/lib/smime/smimeutil.c | 11 | ||||
-rw-r--r-- | security/nss/lib/softoken/dbmshim.c | 5 | ||||
-rw-r--r-- | security/nss/lib/softoken/pcertdb.c | 3 | ||||
-rw-r--r-- | security/nss/lib/softoken/pkcs11.c | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/security/nss/lib/cryptohi/dsautil.c b/security/nss/lib/cryptohi/dsautil.c index c592ec7df..504e69907 100644 --- a/security/nss/lib/cryptohi/dsautil.c +++ b/security/nss/lib/cryptohi/dsautil.c @@ -66,10 +66,9 @@ DSAU_ConvertUnsignedToSigned(SECItem *dest, SECItem *src) unsigned char *pSrc = src->data; unsigned char *pDst = dest->data; unsigned int cntSrc = src->len; - unsigned char c; /* skip any leading zeros. */ - while (cntSrc && !(c = *pSrc)) { + while (cntSrc && !(*pSrc)) { pSrc++; cntSrc--; } @@ -79,7 +78,7 @@ DSAU_ConvertUnsignedToSigned(SECItem *dest, SECItem *src) return; } - if (c & 0x80) + if (*pSrc & 0x80) *pDst++ = 0; PORT_Memcpy(pDst, pSrc, cntSrc); diff --git a/security/nss/lib/pk11wrap/pk11cert.c b/security/nss/lib/pk11wrap/pk11cert.c index 04aa5fca4..be06ceae9 100644 --- a/security/nss/lib/pk11wrap/pk11cert.c +++ b/security/nss/lib/pk11wrap/pk11cert.c @@ -2261,7 +2261,7 @@ pk11_AllFindCertObjectByRecipient(PK11SlotInfo **slotPtr, void *wincx) { PK11SlotList *list; PK11SlotListElement *le; - CERTCertificate * cert; + CERTCertificate * cert = NULL; PK11SlotInfo *slot = NULL; SECStatus rv; @@ -2297,6 +2297,7 @@ pk11_AllFindCertObjectByRecipient(PK11SlotInfo **slotPtr, return NULL; } *slotPtr = slot; + PORT_Assert(cert != NULL); return cert; } diff --git a/security/nss/lib/smime/cmsrecinfo.c b/security/nss/lib/smime/cmsrecinfo.c index 01211cfce..bd1a0a34a 100644 --- a/security/nss/lib/smime/cmsrecinfo.c +++ b/security/nss/lib/smime/cmsrecinfo.c @@ -406,7 +406,7 @@ NSS_CMSRecipientInfo_WrapBulkKey(NSSCMSRecipientInfo *ri, PK11SymKey *bulkkey, NSSCMSOriginatorIdentifierOrKey *oiok; CERTSubjectPublicKeyInfo *spki, *freeSpki = NULL; PLArenaPool *poolp; - NSSCMSKeyTransRecipientInfoEx *extra; + NSSCMSKeyTransRecipientInfoEx *extra = NULL; PRBool usesSubjKeyID; poolp = ri->cmsg->poolp; @@ -443,6 +443,7 @@ NSS_CMSRecipientInfo_WrapBulkKey(NSSCMSRecipientInfo *ri, PK11SymKey *bulkkey, if (rv != SECSuccess) break; } else if (usesSubjKeyID) { + PORT_Assert(extra != NULL); rv = NSS_CMSUtil_EncryptSymKey_RSAPubKey(poolp, extra->pubKey, bulkkey, &ri->ri.keyTransRecipientInfo.encKey); if (rv != SECSuccess) diff --git a/security/nss/lib/smime/smimeutil.c b/security/nss/lib/smime/smimeutil.c index 3ef977d32..6564db294 100644 --- a/security/nss/lib/smime/smimeutil.c +++ b/security/nss/lib/smime/smimeutil.c @@ -237,7 +237,6 @@ nss_smime_get_cipher_for_alg_and_key(SECAlgorithmID *algid, PK11SymKey *key, uns { SECOidTag algtag; unsigned int keylen_bits; - SECStatus rv = SECSuccess; unsigned long c; algtag = SECOID_GetAlgorithmTag(algid); @@ -255,8 +254,7 @@ nss_smime_get_cipher_for_alg_and_key(SECAlgorithmID *algid, PK11SymKey *key, uns c = SMIME_RC2_CBC_128; break; default: - rv = SECFailure; - break; + return SECFailure; } break; case SEC_OID_DES_CBC: @@ -269,11 +267,10 @@ nss_smime_get_cipher_for_alg_and_key(SECAlgorithmID *algid, PK11SymKey *key, uns c = SMIME_FORTEZZA; break; default: - rv = SECFailure; + return SECFailure; } - if (rv == SECSuccess) - *cipher = c; - return rv; + *cipher = c; + return SECSuccess; } static PRBool diff --git a/security/nss/lib/softoken/dbmshim.c b/security/nss/lib/softoken/dbmshim.c index 935780dbf..a085765c6 100644 --- a/security/nss/lib/softoken/dbmshim.c +++ b/security/nss/lib/softoken/dbmshim.c @@ -365,7 +365,7 @@ dbs_readBlob(DBS *dbsp, DBT *data) PRFileMap *mapfile = NULL; unsigned char *addr = NULL; int error; - int len; + int len = -1; file = dbs_getBlobFilePath(dbsp->blobdir, data); if (!file) { @@ -405,9 +405,10 @@ loser: error = PR_GetError(); if (addr) { if (mapfile) { + PORT_Assert(len != -1); PR_MemUnmap(addr,len); } else { - PORT_Free(addr); + PORT_Free(addr); } } if (mapfile) { diff --git a/security/nss/lib/softoken/pcertdb.c b/security/nss/lib/softoken/pcertdb.c index e61f9f831..83a905b6b 100644 --- a/security/nss/lib/softoken/pcertdb.c +++ b/security/nss/lib/softoken/pcertdb.c @@ -3486,7 +3486,6 @@ UpdateV7DB(NSSLOWCERTCertDBHandle *handle, DB *updatedb) case certDBEntryTypeSubject: case certDBEntryTypeContentVersion: case certDBEntryTypeNickname: - /*default: */ break; case certDBEntryTypeCert: @@ -3547,6 +3546,8 @@ UpdateV7DB(NSSLOWCERTCertDBHandle *handle, DB *updatedb) PORT_FreeArena(smimeEntry.common.arena, PR_FALSE); smimeEntry.common.arena = NULL; break; + default: + break; } } while ( (* updatedb->seq)(updatedb, &key, &data, R_NEXT) == 0 ); diff --git a/security/nss/lib/softoken/pkcs11.c b/security/nss/lib/softoken/pkcs11.c index 64491b2c8..90809a9c4 100644 --- a/security/nss/lib/softoken/pkcs11.c +++ b/security/nss/lib/softoken/pkcs11.c @@ -1985,7 +1985,7 @@ pk11_IsWeakKey(unsigned char *key,CK_KEY_TYPE key_type) static NSSLOWKEYPrivateKey * pk11_mkSecretKeyRep(PK11Object *object) { - NSSLOWKEYPrivateKey *privKey; + NSSLOWKEYPrivateKey *privKey = 0; PLArenaPool *arena = 0; CK_RV crv; SECStatus rv; |