Closed Bug 949615 Opened 11 years ago Closed 10 years ago

Delete unreachable code in ssl_DestroySID and ssl_LookupSID lib/ssl/sslnonce.c

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
3.15.5

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
While looking into other bugs, I found some unreachable code in
ssl_DestroySID and ssl_LookupSID lib/ssl/sslnonce.c.

1. ssl_DestroySID: In this function, sid->references must be 0. Code
inspection shows that if |sid| is in the client cache, the client
cache will own a reference. This implies |sid| cannot be in the
client cache. So sid->cached == in_client_cache will never be true.
I replaced the check with an assertion.

2. ssl_LookupSID: The function asserts sid->references >= 1, so the
two !sid->references tests will always be false.

Perhaps in the past NSS used to leave orphaned (reference count 0)
sid's in the client cache and clean them up later.
Attachment #8346722 - Flags: review?(agl)
Attachment #8346722 - Flags: review?(agl) → review+
Comment on attachment 8346722 [details] [diff] [review]
Patch

Review of attachment 8346722 [details] [diff] [review]:
-----------------------------------------------------------------

Patch checked in: https://hg.mozilla.org/projects/nss/rev/370718a90fc8
Attachment #8346722 - Flags: checked-in+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: 3.15.5 → 3.16
Target Milestone: 3.16 → 3.15.5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: