Closed Bug 1614870 Opened 5 years ago Closed 5 years ago

Memory leak in on sid->peerID in ssl_DecodeResumptionToken

Categories

(NSS :: Libraries, defect, P1)

3.51
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kjacobs, Assigned: kjacobs)

References

Details

Attachments

(1 file)

Bug 1607257 reports memory leaks when using external token caching. In SSLExp_SetResumptionToken, ssl3_NewSessionID allocates sid->peerID then ssl_DecodeResumptionToken does it again (via PORT_Strdup) without freeing.

Confirmed via https://treeherder.mozilla.org/#/jobs?repo=try&revision=adecc16291e291121ca2456cc5962928044177dc and https://treeherder.mozilla.org/#/jobs?repo=try&revision=9dadb29155c738a9bbba9bc9dc12aec641a355fc

It looks like gtests miss this case by not setting a peerID on the socket.

This patch adds a missing PORT_Free() when reallocating sid->PeerID, and adds a test for a non-empty PeerID.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Hi Kevin,

Do you know when will this change be uplifted to mc?
If possible, I'd like to enable SSLTokensCache in next release cycle.

Thanks.

Flags: needinfo?(kjacobs.bugzilla)

It was uplifted yesterday, though Searchfox hasn't updated yet: https://hg.mozilla.org/mozilla-central/rev/b356f4fe601fe1ceeaf4081b409944569ecaaa34

Flags: needinfo?(kjacobs.bugzilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: