Closed Bug 338356 Opened 19 years ago Closed 19 years ago

Coverity Leak in PK11_TokenKeyGenWithFlags (security/nss/lib/pk11wrap/pk11skey.c)

Categories

(NSS :: Libraries, defect, P2)

3.10
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.2

People

(Reporter: kherron+mozilla, Assigned: nelson)

References

()

Details

(Keywords: coverity, Whiteboard: CID 318)

Attachments

(1 file, 1 obsolete file)

This is coverity CID 318. Please see the sample URL. |pk11_CreateSymKey| normally returns a pointer to allocated memory (via PORT_New). Here, the calls at lines 943 and 947 are leaked if the test at 956 succeeds.
correction to comment 0: the SYMKEYS allocated at lines 943 and 947 are leaked if the test at 956 succeeds.
Assignee: nobody → rrelyea
Severity: minor → normal
Priority: -- → P2
Target Milestone: --- → 3.11.2
Version: unspecified → 3.10
Attached patch patch - alternative 1 of 2 (obsolete) — Splinter Review
This is one of two alternative patches for this bug. Bob, please pick one.
Assignee: rrelyea → nelson
Status: NEW → ASSIGNED
Attachment #224829 - Flags: review?(rrelyea)
This is the second of the proposed alternatives.
Attachment #224830 - Flags: review?(rrelyea)
The second alternative is intended to avoid unnecessarily allocating and freeing a symkey object before we're sure we've got the right conditions to use it once created. Bob, please vote ith your review. :)
Comment on attachment 224829 [details] [diff] [review] patch - alternative 1 of 2 I'm withdrawing the review request for this patch, because I only want to check in the other one.
Attachment #224829 - Attachment is obsolete: true
Attachment #224829 - Flags: review?(rrelyea)
Attachment #224830 - Flags: review?(alexei.volkov.bugs)
Comment on attachment 224830 [details] [diff] [review] Patch - Alternative 2 I think it will work. r=alexei.volkov
Attachment #224830 - Flags: review?(alexei.volkov.bugs) → review+
Fix leak and OOM crash. Bug 338352 and 338356. Coverity. r=rrelyea, alexei.volkov Checking in pk11skey.c; new revision: 1.109; previous revision: 1.108 Checking in pk11skey.c; new revision: 1.108.2.1; previous revision: 1.108
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
CID 318
Whiteboard: CID 318
Comment on attachment 224830 [details] [diff] [review] Patch - Alternative 2 r=rrelyea Moving the test is safe and the right thing to do. bob
Attachment #224830 - Flags: review?(rrelyea) → review+
Summary: Leak in PK11_TokenKeyGenWithFlags (security/nss/lib/pk11wrap/pk11skey.c) → Coverity Leak in PK11_TokenKeyGenWithFlags (security/nss/lib/pk11wrap/pk11skey.c)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: