Closed
Bug 337080
Opened 19 years ago
Closed 19 years ago
Coverity 681, dead code in mozilla/security/nss/lib/ssl/ssl3con.c
Categories
(NSS :: Libraries, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.2
People
(Reporter: jonsmirl, Assigned: nelson)
Details
(Keywords: coverity, Whiteboard: [CID 160 681 853 952])
Attachments
(2 files)
936 bytes,
patch
|
nelson
:
review-
|
Details | Diff | Splinter Review |
1.23 KB,
patch
|
alvolkov.bgs
:
review+
|
Details | Diff | Splinter Review |
Clean up error path to remove dead code. So far I have found one dead code flag that was a bug. If these are cleaned Coverity won't keep hitting them.
diff -u -r1.76 ssl3con.c
--- security/nss/lib/ssl/ssl3con.c 18 Nov 2005 01:25:20 -0000 1.76
+++ security/nss/lib/ssl/ssl3con.c 8 May 2006 03:52:30 -0000
@@ -1849,16 +1849,12 @@
PORT_Assert(rv == SECSuccess && cipherBytesPart2 == p2Len);
if (rv != SECSuccess || cipherBytesPart2 != p2Len) {
PORT_SetError(SSL_ERROR_ENCRYPTION_FAILURE);
- goto spec_locked_loser;
- }
+spec_locked_loser:
+ ssl_ReleaseSpecReadLock(ss);
+ return SECFailure;
+ }
cipherBytes += cipherBytesPart2;
}
- if (rv != SECSuccess) {
- ssl_MapLowLevelError(SSL_ERROR_ENCRYPTION_FAILURE);
-spec_locked_loser:
- ssl_ReleaseSpecReadLock(ss);
- return SECFailure;
- }
PORT_Assert(cipherBytes <= MAX_FRAGMENT_LENGTH + 1024);
/*
Assignee | ||
Updated•19 years ago
|
Severity: normal → trivial
Priority: -- → P3
Attachment #221256 -
Flags: review?(wtchang)
Assignee | ||
Comment 2•19 years ago
|
||
Comment on attachment 221256 [details] [diff] [review]
Clean up error path
There's no incorrect behavior here, nothing that produces wrong results.
Moving the common code into one of the cases that invokes it doesn't make the code clearer or more maintainable.
Attachment #221256 -
Flags: review?(wtchang) → review-
These two lines are unreachable.
- if (rv != SECSuccess) {
- ssl_MapLowLevelError(SSL_ERROR_ENCRYPTION_FAILURE);
When you remove them it makes sense to move the label and the code.
Assignee | ||
Comment 4•19 years ago
|
||
(In reply to comment #3)
> These two lines are unreachable.
>
> - if (rv != SECSuccess) {
> - ssl_MapLowLevelError(SSL_ERROR_ENCRYPTION_FAILURE);
try replacing them with
> + if (0) {
Assignee | ||
Updated•19 years ago
|
Assignee: nobody → nelson
Assignee | ||
Comment 5•19 years ago
|
||
Alexei, please review
Attachment #222467 -
Flags: review?(alexei.volkov.bugs)
Comment 6•19 years ago
|
||
Comment on attachment 222467 [details] [diff] [review]
YA alternative
r=alexei.volkov.bugs
Attachment #222467 -
Flags: review?(alexei.volkov.bugs) → review+
Assignee | ||
Comment 7•19 years ago
|
||
Checking in ssl/ssl3con.c; new revision: 1.90; previous revision: 1.89
Checking in ssl3con.c; new revision: 1.76.2.12; previous revision: 1.76.2.11
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•19 years ago
|
||
Also CID 952
Whiteboard: [CID 160 681 853] → [CID 160 681 853 952]
You need to log in
before you can comment on or make changes to this bug.
Description
•