Coverity 171, dead code in mozilla/security/nss/lib/softoken/pcertdb.c

RESOLVED FIXED in 3.11.2

Status

NSS
Libraries
P3
trivial
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Jon Smirl, Assigned: Wan-Teh Chang)

Tracking

({coverity})

3.11
3.11.2
All
Linux
coverity

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: CID 171)

Attachments

(1 attachment, 1 obsolete attachment)

641 bytes, patch
Nelson Bolyard (seldom reads bugmail)
: review+
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
AddNicknameToSubject()
{
// check for NUll is done at top of routine
    if ( nickname == NULL ) {
	return(SECFailure);
    }

This later check is not needed since the variable does not get changed

diff -r1.53 pcertdb.c
2797,2798c2797
<     entry->nickname = (nickname) ?
<                       PORT_ArenaStrdup(entry->common.arena, nickname) : NULL;
---
>     entry->nickname = PORT_ArenaStrdup(entry->common.arena, nickname);
(Reporter)

Comment 1

12 years ago
Created attachment 221127 [details] [diff] [review]
Remove dead code
Keywords: coverity
Hardware: PC → All
Target Milestone: --- → 3.11.2
Version: unspecified → 3.11
Severity: normal → trivial
Priority: -- → P3
(Reporter)

Updated

12 years ago
Attachment #221127 - Flags: review?(wtchang)
(Reporter)

Comment 2

12 years ago
Created attachment 221766 [details] [diff] [review]
Unified diff, patch is the same
Attachment #221127 - Attachment is obsolete: true
Attachment #221766 - Flags: review?(wtchang)
Attachment #221127 - Flags: review?(wtchang)
Comment on attachment 221766 [details] [diff] [review]
Unified diff, patch is the same

r=nelson
Attachment #221766 - Flags: review?(wtchang) → review+
(Assignee)

Comment 4

12 years ago
I checked in the patch on the NSS trunk (NSS 3.12) and
NSS_3_11_BRANCH (NSS 3.11.2).
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Assignee: nobody → wtchang
Whiteboard: CID 171
You need to log in before you can comment on or make changes to this bug.