Closed
Bug 103893
Opened 24 years ago
Closed 24 years ago
nickname is not NULL-terminated
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.3.2
People
(Reporter: jamie-bugzilla, Assigned: jamie-bugzilla)
Details
Attachments
(1 file)
756 bytes,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
This code at pkcs11.c:656, in pk11_handleCertObject, doesn't properly
NULL-terminate the copied nickname string.
cert->nickname = (char *)PORT_ArenaAlloc(cert->arena, PORT_Strlen(label)+1);
if(cert->nickname == NULL) {
return CKR_HOST_MEMORY;
}
PORT_Memcpy(cert->nickname, label, PORT_Strlen(label));
This doesn't cause any problems in the code path I witnessed, but it did cause
some confusion during debugging.
Comment 1•24 years ago
|
||
That whole thing can be replaced by a PORT_ArenaStrdup call:
cert->nickname = PORT_ArenaStrdup(cert->arena, label);
Could you take care of that? Do you think this fix should
also be checked in on the NSS_3_3_BRANCH?
Assignee: wtc → nicolson
Priority: -- → P2
Target Milestone: --- → 3.4
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
OK, checked in on the NSS_3_3_BRANCH and the trunk.
/cvsroot/mozilla/security/nss/lib/softoken/pkcs11.c,v <-- pkcs11.c
new revision: 1.8.2.3; previous revision: 1.8.2.2
/cvsroot/mozilla/security/nss/lib/softoken/pkcs11.c,v <-- pkcs11.c
new revision: 1.17; previous revision: 1.16
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
Attachment #52769 -
Flags: review+
Comment 4•24 years ago
|
||
Looks good.
r=relyea
Comment 5•24 years ago
|
||
Changed target milestone to 3.3.2 because the fix is in
3.3.2.
Target Milestone: 3.4 → 3.3.2
You need to log in
before you can comment on or make changes to this bug.
Description
•