Closed
Bug 486405
Opened 16 years ago
Closed 16 years ago
Allocator mismatches in pk12util.c
Categories
(NSS :: Tools, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
3.12.4
People
(Reporter: neil, Assigned: nelson)
Details
Attachments
(1 file)
3.51 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
p12u_DestroyContext uses PR_Free((*ppCtx)->filename); but
p12u_InitContext uses p12ctx->filename = strdup(filename);
Either p12u_DestroyContext could be changed to use free() or they could both be switched e.g. to PL_strdup and PL_strfree.
main uses PORT_ZFree(p12FilePw.data, PL_strlen(p12FilePw.data)); but earlier allocated it using PL_strdup. I understand PORT_ZFree is a secure delete, otherwise I would have simply suggested switching to PL_strfree.
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → nelson
Priority: -- → P3
Target Milestone: --- → 3.12.4
Version: unspecified → 3.2
Assignee | ||
Comment 1•16 years ago
|
||
This patch works, in that it passes our usual NSS tests.
I believe it fixes the allocator mismatch problems.
Neil, if it is convenient for you to do so, please test this patch
with your allocator mismatch testing apparatus. Thanks.
Attachment #370705 -
Flags: review?(neil)
Reporter | ||
Comment 2•16 years ago
|
||
Comment on attachment 370705 [details] [diff] [review]
Patch v1 for NSS Trunk
This patch successfully passes my allocator mismatch detection.
Attachment #370705 -
Flags: review?(neil) → review+
Reporter | ||
Comment 3•16 years ago
|
||
Comment on attachment 370705 [details] [diff] [review]
Patch v1 for NSS Trunk
>+ if (slot)
>+ PK11_FreeSlot(slot);
Note: I don't know what spacing guide you use, but as the git-apply utility points out, the first of these two lines ends with a space, while the second contains four spaces followed by a tab.
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #3)
> Note: I don't know what spacing guide you use, but as the git-apply utility
> points out, the first of these two lines ends with a space, while the second
> contains four spaces followed by a tab.
NSS spacing guidelines are published somehwere, but here is a short summary
- we don't care about trailing spaces
- our tab stops are set every 8 columns
- our "indentation quantum" is 4 columns.
We allow any combination of tabs and spaces to be used to achieve proper indentation (provided that it looks right when tabs are set to 8 columns).
Although it is slightly preferrable to not preceed tabs with spaces, as long
as it looks right...
So, the above observations do not indicate unacceptable code for NSS.
Assignee | ||
Comment 5•16 years ago
|
||
Checking in pk12util.c; new revision: 1.41; previous revision: 1.40
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 6•16 years ago
|
||
I wonder if this is in any way related to bug 486811 . The line numbers for the patch don't match the other stacks though.
Assignee | ||
Comment 7•16 years ago
|
||
I'd guess we have other allocator mismatches that we have not yet uncovered.
You need to log in
before you can comment on or make changes to this bug.
Description
•