Closed Bug 552951 Opened 15 years ago Closed 14 years ago

nsKeygenFormProcessor::GetPublicKey doesn't use pqgParams/arena created by decode_pqg_params

Categories

(Core Graveyard :: Security: UI, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla5

People

(Reporter: timeless, Assigned: timeless)

References

Details

(Keywords: coverity, memory-leak, Whiteboard: [psm-easy])

Attachments

(2 files)

505 nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& 516 PQGParams *pqgParams; 579 found_match: 580 pqgParams = decode_pqg_params(str);
Assignee: kaie → nobody
Whiteboard: [psm-easy]
Attached patch patch v1Splinter Review
kaie: @@ -577,7 +576,7 @@ nsKeygenFormProcessor::GetPublicKey(nsAS is the real change. does this really make sense?
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #495386 - Flags: review?(kaie)
Attachment #495386 - Flags: approval2.0?
The interesting piece from your patch, you found that the value created in the following line is never used. diff --git a/security/manager/ssl/src/nsKeygenHandler.cpp b/security/manager/ssl/src/nsKeygenHandler.cpp --- a/security/manager/ssl/src/nsKeygenHandler.cpp +++ b/security/manager/ssl/src/nsKeygenHandler.cpp @@ -577,7 +576,7 @@ nsKeygenFormProcessor::GetPublicKey(nsAS } while (end != nsnull); goto loser; found_match: pqgParams = decode_pqg_params(str); <------- According to CVS blame, this hasn't changed since initial CVS checkin. In function nsKeygenFormProcessor::GetPublicKey, variable pqgParams was never used.
Comment on attachment 495386 [details] [diff] [review] patch v1 I believe the call to decode_pqg_params was accidentally left in the code. I'm guessing the original code was doing things inline, and now this check is being done inside function pqg_prime_bits. The call to decode_pqg_params doesn't have any effects besides creating the leaked return object. I agree it's OK to remove this call and the variable. I'm also OK with your other cleanup in this patch. I'm not happy about introducing (void)0; I understand, though, it's necessary because of the goto label. Sigh. Therefore, I give r=kaie for this patch, but would like to see a follow up patch that removes this ugliness and gets rid of the goto. I'll attach that follow up patch.
Attachment #495386 - Flags: review?(kaie) → review+
Attachment #495386 - Attachment description: proposal → patch v1
Unrelated to the bug, patch on top of v1. Replacing "goto found_match" and ugly statements with a bool.
Attachment #499367 - Flags: review?(honzab.moz)
Comment on attachment 499367 [details] [diff] [review] incremental patch v2 r=honzab
Attachment #499367 - Flags: review?(honzab.moz) → review+
Comment on attachment 499367 [details] [diff] [review] incremental patch v2 Note to drivers: Please approve both patches.
Attachment #499367 - Flags: approval2.0?
Comment on attachment 495386 [details] [diff] [review] patch v1 At this point drivers need to know why you want this and what the risk is. Feel free to renominate with those.
Attachment #495386 - Flags: approval2.0? → approval2.0-
Attachment #499367 - Flags: approval2.0? → approval2.0-
The keywords say it all: We want it, because we want Firefox to be more correct and have less memory leaks. What flag am I supposed to set, so we don't forget to land this later on?
Probably make it dep on bug 610267.
(In reply to comment #9) > Probably make it dep on bug 610267. Thanks a lot, that helps!
Depends on: post2.0
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
Can someone confirm if this is fixed?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: