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)

3.11
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.2

People

(Reporter: timeless, Assigned: alvolkov.bgs)

References

()

Details

(Keywords: coverity, Whiteboard: CID 316)

Attachments

(1 file)

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.
Hardware: PC → All
Target Milestone: --- → 3.11.2
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: nobody → alexei.volkov.bugs
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 on attachment 222124 [details] [diff] [review] verify that "instances" is not null ptr r=nelson
Attachment #222124 - Flags: review?(nelson) → review+
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
CID 316
Whiteboard: CID 316
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: