Closed
Bug 330056
Opened 19 years ago
Closed 19 years ago
seckey_put_private_key leaks memory
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.3
People
(Reporter: wyllys.ingersoll, Assigned: alvolkov.bgs)
Details
Attachments
(1 file, 1 obsolete file)
3.58 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8) Gecko/20051122 Firefox/1.5
Build Identifier: 3.10
seckey_put_private_key (from security/nss/lib/softoken/keydb.c) leaks
memory allocated for the dbkey structure.
"permarena" is allocated locally but it is not freed unless the status != SECSuccess. It should be freed always because it is never used or referenced again.
Reproducible: Always
Steps to Reproduce:
1. Call PK11_GenerateKeyPair (with IsPermanent== TRUE, IsSensitive == TRUE)
2. Call PK11_DeleteTokenPublicKey()
3. Call PK11_DeleteTokenPrivateKey()
Check for leaks.
Comment 1•19 years ago
|
||
Appears to have been there in the original NSS 3.0 code.
Thanks for the report, Wyllys.
Assignee: wtchang → alexei.volkov.bugs
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Solaris → All
Priority: -- → P2
Hardware: Sun → All
Target Milestone: --- → 3.11.1
Version: unspecified → 3.0
Updated•19 years ago
|
QA Contact: jason.m.reid → libraries
Assignee | ||
Comment 2•19 years ago
|
||
Attachment #226727 -
Flags: review?(nelson)
Comment 3•19 years ago
|
||
Comment on attachment 226727 [details] [diff] [review]
free permarena regardless rv value
r=nelson
Attachment #226727 -
Flags: review?(nelson) → review+
Assignee | ||
Comment 4•19 years ago
|
||
Comment on attachment 226727 [details] [diff] [review]
free permarena regardless rv value
Fix is in softoken. I think this is important to have it fix in 3.11.x release. Asking for second review.
Attachment #226727 -
Flags: superreview?(wtchang)
Comment 5•19 years ago
|
||
Comment on attachment 226727 [details] [diff] [review]
free permarena regardless rv value
r=wtc. You can check in this patch on the NSS_3_11_BRANCH.
The variable name 'permarena' is misleading in this function.
It should be renamed 'arena'. The variable 'temparena' should
be removed, with the following code:
if(temparena != NULL)
PORT_FreeArena(temparena, PR_TRUE);
replaced by:
if(epki != NULL)
PORT_FreeArena(epki->arena, PR_TRUE);
Attachment #226727 -
Flags: superreview?(wtchang) → superreview+
Assignee | ||
Comment 6•19 years ago
|
||
tip:
/cvsroot/mozilla/security/nss/lib/softoken/keydb.c,v <-- keydb.c
new revision: 1.48; previous revision: 1.47
3.11 branch:
/cvsroot/mozilla/security/nss/lib/softoken/keydb.c,v <-- keydb.c
new revision: 1.40.2.6; previous revision: 1.40.2.5
Comment 7•19 years ago
|
||
Please attach the patch you actually checked in.
Target Milestone: 3.11.1 → 3.11.3
Assignee | ||
Comment 8•19 years ago
|
||
Attachment #226727 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•