Closed
Bug 1256268
Opened 8 years ago
Closed 8 years ago
Resource leaks in fipstest.c
Categories
(NSS :: Test, defect)
NSS
Test
Tracking
(firefox48 affected)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox48 | --- | affected |
People
(Reporter: franziskus, Assigned: franziskus)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1355468, CID 983285, CID 983283, CID 983282, CID 1355469, CID 1355467)
Attachments
(2 files)
1.80 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
3.06 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
The file fipstest.c contains multiple resource leaks in function drbg, i.e. the loser label does not free any variables. * predictedreturn_bytes (CID 1355468) * additionalInput (CID 983285) * personalizationString (CID 983284) * nonce (CID 983283) * entropyInput (CID 983282) * predictedreturn_bytes (CID 1355468) * return_bytes (CID 1355467)
Assignee | ||
Comment 1•8 years ago
|
||
adding CID 1355469 in pk1sign.c (data in SignFile is not freed)
Whiteboard: CID 1355468, CID 983285, CID 983283, CID 983282, CID 1355468, CID 1355467 → CID 1355468, CID 983285, CID 983283, CID 983282, CID 1355469, CID 1355467
Assignee | ||
Comment 2•8 years ago
|
||
Assignee: nobody → franziskuskiefer
Attachment #8732840 -
Flags: review?(ttaubert)
Comment 3•8 years ago
|
||
Comment on attachment 8732840 [details] [diff] [review] fixing-resource-leaks.patch Review of attachment 8732840 [details] [diff] [review]: ----------------------------------------------------------------- ::: cmd/pk1sign/pk1sign.c @@ +162,5 @@ > ExportPublicKey(outFile, cert); > > SECKEY_DestroyPrivateKey(privKey); > PORT_FreeArena(arena, PR_FALSE); > + PORT_Free(data); There are a few "return -1" lines in this function where we return early upon error. Looks like we'd leak the arena and the private key then, maybe we should come back later and rewrite this in C-style using the "goto loser" pattern.
Attachment #8732840 -
Flags: review?(ttaubert) → review+
Assignee | ||
Comment 4•8 years ago
|
||
follow up to make SignFile free all the things on return.
Attachment #8732875 -
Flags: review?(ttaubert)
Updated•8 years ago
|
Attachment #8732875 -
Flags: review?(ttaubert) → review+
Assignee | ||
Comment 5•8 years ago
|
||
https://hg.mozilla.org/projects/nss/rev/3e097ed7969a https://hg.mozilla.org/projects/nss/rev/e859db13b9da
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•