Closed
Bug 644070
Opened 14 years ago
Closed 14 years ago
nsNSSCertificate::defaultServerNickname leaks in case of server name conflict
Categories
(Core :: Security: PSM, defect)
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
()
Details
(Keywords: memory-leak)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
The OS X leaks report tool found this leak, under this stack:
[thread 0x12250a000]: | thread_start | _pthread_start | _pt_root | nsSSLThread::Run() | ssl_Write | ssl_SecureSend | ssl_Do1stHandshake | ssl_Gather Record1stHandshake | ssl3_GatherCompleteHandshake | ssl3_HandleRecord | ssl3_HandleHandshakeMessage | AuthCertificateCallback(void*, PRFileDesc*, int, int) | nsNSSCerti ficate::defaultServerNickname(CERTCertificateStr*) | PR_smprintf | PR_vsmprintf | dosprintf | GrowStuff | PR_Realloc | realloc | malloc_zone_realloc
What's happening is that if SEC_CertNicknameConflict returns false, we fail to free the value stored in nickname.
This may be one of the leaks of bug 497808. I found it while I was trying to use the leaks tool to debug that bug.
Assignee | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Comment on attachment 521123 [details] [diff] [review]
Patch (v1)
r=honzab
Attachment #521123 -
Flags: review?(honzab.moz) → review+
Assignee | ||
Comment 3•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Whiteboard: [post-2.0]
Target Milestone: --- → mozilla2.2
Assignee | ||
Comment 4•14 years ago
|
||
Hmm, actually my patch was incorrect. It turned the Mac browser-chrome suite orange (luckily) so I backed it out: http://hg.mozilla.org/mozilla-central/rev/741701875aec
If |conflict| is false, we end up returning |nickname|, so freeing it would be a mistake.
Seems like the job of freeing the returned string should be put on the callers, or we should just return a string instead of a char*...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 5•14 years ago
|
||
Attachment #521123 -
Attachment is obsolete: true
Attachment #521373 -
Flags: review?(honzab.moz)
Comment 6•14 years ago
|
||
Oh crap! Collective blindness... Will look at this ASAP.
Comment 7•14 years ago
|
||
Comment on attachment 521373 [details] [diff] [review]
Patch (v2)
Thanks.
r=honzab.
Attachment #521373 -
Flags: review?(honzab.moz) → review+
Assignee | ||
Comment 8•14 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•