[Coverity 1242967 + 1242914 + 221900] Dead code and unused values in AddCertToPermDB

RESOLVED FIXED

Status

NSS
Libraries
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(firefox44 affected)

Details

(Assignee)

Description

3 years ago
> loser:
>     /* don't leave partial entry in the database */
>     if ( state > 0 ) {
>         rv = DeleteDBCertEntry(handle, &cert->certKey);
>     }
>     if ( ( state > 1 ) && donnentry ) {
>         rv = DeleteDBNicknameEntry(handle, nickname);
>     }
>     if ( state > 2 ) {
>         rv = DeleteDBSubjectEntry(handle, &cert->derSubject);
>     }

returned_value: Assigning value from DeleteDBCertEntry(handle, &cert->certKey) to rv here, but that stored value is overwritten before it can be used.

returned_value: Assigning value from DeleteDBNicknameEntry(handle, nickname) to rv here, but that stored value is overwritten before it can be used.

between: At condition state > 2, the value of state must be between 0 and 2.

dead_error_condition: The condition state > 2 cannot be true.

dead_error_line: Execution cannot reach this statement: rv = DeleteDBSubjectEntry(h....
(Assignee)

Comment 1

3 years ago
Patch at: https://codereview.appspot.com/269040043
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)

Comment 2

3 years ago
LGTM
Flags: needinfo?(ekr)
https://hg.mozilla.org/projects/nss/rev/ad20cefe5531
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(martin.thomson)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.