Closed Bug 336482 Opened 15 years ago Closed 15 years ago

Coverity crash or hopefully deadcode [@ crmf_copy_poposigningkey] because Pointer "destPopoSignKey" dereferenced before NULL check

Categories

(NSS :: Libraries, defect, P2)

3.11
All
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.2

People

(Reporter: timeless, Assigned: alvolkov.bgs)

References

()

Details

(Keywords: coverity, crash, Whiteboard: CID 631)

Crash Data

Attachments

(1 file)

this looks like something that could be asserted, but at the very least, the null check in loser is pointless.
Hardware: PC → All
Target Milestone: --- → 3.11.2
Priority: -- → P2
Assignee: nobody → alexei.volkov.bugs
Not a bug, us all callers of the functions check for NULL the destination pointer before copy data into it.

Non of the object copy functions check for incoming parameter before dereferencing them. This functionality should be implemented in a caller.

The patch removes unnecessary checks for NULL before structure destruction.
Attachment #221868 - Flags: review?(nelson)
Comment on attachment 221868 [details] [diff] [review]
remove null check

I have a feeling that someday we'll see these functions get called with NULL arguments, and someone will ask why the function doesn't check its arguments for NULL as the very first thing.  

But this patch is no less correct than before, and it should silence Coverity.  So 
r=nelson
Attachment #221868 - Flags: review?(nelson) → review+
trunk
/cvsroot/mozilla/security/nss/lib/crmf/servget.c,v  <--  servget.c
new revision: 1.5; previous revision: 1.4

3.11 branch
/cvsroot/mozilla/security/nss/lib/crmf/servget.c,v  <--  servget.c
new revision: 1.3.28.2; previous revision: 1.3.28.1
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Attachment #221868 - Flags: review+
CID 631
Whiteboard: CID 631
Summary: crash or hopefully deadcode [@ crmf_copy_poposigningkey] because Pointer "destPopoSignKey" dereferenced before NULL check → Coverity crash or hopefully deadcode [@ crmf_copy_poposigningkey] because Pointer "destPopoSignKey" dereferenced before NULL check
Crash Signature: [@ crmf_copy_poposigningkey]
You need to log in before you can comment on or make changes to this bug.