Closed
Bug 353773
Opened 20 years ago
Closed 19 years ago
klocwork Null ptr dereferences in pk11nobj.c
Categories
(NSS :: Libraries, defect, P2)
NSS
Libraries
Tracking
(Not tracked)
RESOLVED
FIXED
3.12
People
(Reporter: nelson, Assigned: alvolkov.bgs)
Details
(Keywords: klocwork)
Attachments
(1 file, 1 obsolete file)
|
1.53 KB,
patch
|
nelson
:
review+
|
Details | Diff | Splinter Review |
ID: 92202
Function: SEC_DeletePermCRL
Location: nss/lib/pk11wrap/pk11nobj.c : 550
Pointer 'object' returned from call to function 'nss_ZAlloc' at line 549
may be NULL and will be dereferenced at line 550.
549 object = nss_ZNEW(NULL, nssCryptokiObject);
550 object->token = nssToken_AddRef(token);
551 object->handle = crl->pkcs11ID;
552 object->isTokenObject = PR_TRUE;
----
ID: 88551
Function: PK11_FindSMimeProfile
Location: nss/lib/pk11wrap/pk11nobj.c : 602
Pointer 'list' returned from call to function 'PK11_GetAllTokens' at
line 597 may be NULL and will be dereferenced at line 602.
597 PK11SlotList *list = PK11_GetAllTokens(CKM_INVALID_MECHANISM,
598 PR_FALSE,PR_TRUE,NULL);
599 PK11SlotListElement *le;
602 for (le = list->head; le; le = le->next) {
| Assignee | ||
Comment 1•19 years ago
|
||
Assignee: nobody → alexei.volkov.bugs
Status: NEW → ASSIGNED
Attachment #241192 -
Flags: review?(nelson)
| Reporter | ||
Updated•19 years ago
|
Priority: -- → P2
Target Milestone: --- → 3.12
| Reporter | ||
Comment 2•19 years ago
|
||
Comment on attachment 241192 [details] [diff] [review]
fixes
If PK11_GetAllTokens returns NULL, that is a fatal error in itself.
In that case, we should return NULL right away, without setting a
diffrent error code, such as SEC_ERROR_NO_KRL.
Attachment #241192 -
Flags: review?(nelson) → review-
| Assignee | ||
Comment 3•19 years ago
|
||
Attachment #241192 -
Attachment is obsolete: true
Attachment #241202 -
Flags: review?(nelson)
| Reporter | ||
Comment 4•19 years ago
|
||
Comment on attachment 241202 [details] [diff] [review]
do not change error code returned by PK11_GetAllTokens
r=nelson for trunk
Attachment #241202 -
Flags: review?(nelson) → review+
| Assignee | ||
Comment 5•19 years ago
|
||
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11nobj.c,v <-- pk11nobj.c
new revision: 1.8; previous revision: 1.7
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•