Closed Bug 337025 Opened 19 years ago Closed 19 years ago

Coverity 411, dead code in mozilla/security/nss/lib/certdb/stanpcertdb.c

Categories

(NSS :: Libraries, defect, P5)

3.11
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.2

People

(Reporter: jonsmirl, Assigned: alvolkov.bgs)

Details

(Keywords: coverity, Whiteboard: [CID 411])

Attachments

(2 files)

The checks for emailProfile!=NULL and profileTime!=NULL are redundant since they were checked to be not NULL a couple of lines earlier. 812 } else if (profileTime && emailProfile) { @@ -815,18 +815,13 @@ NSSItem profTime, profData; NSSItem *pprofTime, *pprofData; NSSITEM_FROM_SECITEM(&subject, &cert->derSubject); - if (profileTime) { - NSSITEM_FROM_SECITEM(&profTime, profileTime); - pprofTime = &profTime; - } else { - pprofTime = NULL; - } - if (emailProfile) { - NSSITEM_FROM_SECITEM(&profData, emailProfile); - pprofData = &profData; - } else { - pprofData = NULL; - } + + NSSITEM_FROM_SECITEM(&profTime, profileTime); + pprofTime = &profTime; + + NSSITEM_FROM_SECITEM(&profData, emailProfile); + pprofData = &profData; + stanProfile = nssSMIMEProfile_Create(c, pprofTime, pprofData); if (!stanProfile) goto loser; nssrv = nssCryptoContext_ImportSMIMEProfile(cc, stanProfile);
Attached patch remove dead codeSplinter Review
Severity: normal → trivial
OS: Linux → All
Priority: -- → P5
Hardware: PC → All
Version: unspecified → 3.11
Comment on attachment 221213 [details] [diff] [review] remove dead code r=nelson I'll ask Alexei to commit this.
Attachment #221213 - Flags: review+
Target Milestone: --- → 3.11.2
trunk /cvsroot/mozilla/security/nss/lib/certdb/stanpcertdb.c,v <-- stanpcertdb.c new revision: 1.69; previous revision: 1.68 3.11 branch /cvsroot/mozilla/security/nss/lib/certdb/stanpcertdb.c,v <-- stanpcertdb.c new revision: 1.67.28.2; previous revision: 1.67.28.1
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee: nobody → alexei.volkov.bugs
Comment on attachment 221213 [details] [diff] [review] remove dead code r=wtc. I found more dead code that can be removed. I will attach a patch next.
Attachment #221213 - Flags: review+
1. 'subject' is assigned but not used. 2. 'pprofTime' and 'pprofData' always have the values &profTime and &profData and so aren't necessary any more.
Attachment #222117 - Flags: superreview?(nelson)
Attachment #222117 - Flags: review?(alexei.volkov.bugs)
Comment on attachment 222117 [details] [diff] [review] Remove more dead code r=nelson
Attachment #222117 - Flags: superreview?(nelson) → review+
Attachment #222117 - Flags: review?(alexei.volkov.bugs) → review+
Comment on attachment 222117 [details] [diff] [review] Remove more dead code I checked in this patch "remove more dead code" on the NSS trunk (3.12) and NSS_3_11_BRANCH (3.11.2).
Coverity CID 411
Whiteboard: [CID 411]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: