Closed
Bug 336485
Opened 20 years ago
Closed 20 years ago
coverity thinks that nssPKIObject_GetInstances could return null which would lead to a crash [@ listCertsCallback]
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.2
People
(Reporter: timeless, Assigned: alvolkov.bgs)
References
()
Details
(Keywords: coverity, Whiteboard: CID 316)
Attachments
(1 file)
|
973 bytes,
patch
|
nelson
:
review+
|
Details | Diff | Splinter Review |
Checker: NULL_RETURNS
File: mozilla/security/nss/lib/pk11wrap/pk11cert.c
Function: listCertsCallback
Description: Dereferencing NULL value "ci"
Event returned_null: Function "nssPKIObject_GetInstances" returned NULL value (checked 5 out of 6 times)
Event var_assigned: Variable "instances" assigned to NULL return value from "nssPKIObject_GetInstances"
I believe that this is actually a false positive, but it'd be nice if someone could quiet coverity.
Updated•20 years ago
|
Hardware: PC → All
Target Milestone: --- → 3.11.2
Comment 1•20 years ago
|
||
I agree we should insert a NULL check there in listCertsCallback before
dereferencing "instances", even if it is "impossible" in this case.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Priority: -- → P2
Summary: Please try to quiet coverity because it thinks that nssPKIObject_GetInstances would normally be able to return null which would lead to a crash [@ listCertsCallback] → coverity thinks that nssPKIObject_GetInstances could return null which would lead to a crash [@ listCertsCallback]
| Assignee | ||
Updated•20 years ago
|
Assignee: nobody → alexei.volkov.bugs
| Assignee | ||
Comment 2•20 years ago
|
||
No need to set an error code in this case, since it would be already set by array allocation macro.
Attachment #222124 -
Flags: review?(nelson)
Comment 3•20 years ago
|
||
Comment on attachment 222124 [details] [diff] [review]
verify that "instances" is not null ptr
r=nelson
Attachment #222124 -
Flags: review?(nelson) → review+
| Assignee | ||
Comment 4•20 years ago
|
||
trunk
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v <-- pk11cert.c
new revision: 1.149; previous revision: 1.148
3.11 branch
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v <-- pk11cert.c
new revision: 1.143.2.5; previous revision: 1.143.2.4
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•