Closed Bug 1042634 Opened 10 years ago Closed 10 years ago

Incorrect NULL check in function CRMF_CertReqMsgGetPOPKeyEncipherment (servget.c)

Categories

(NSS :: Libraries, defect)

3.16.3
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sachingpt999, Unassigned)

Details

Attachments

(1 file)

In the file nss/lib/crmf/servget.c, the function CRMF_CertReqMsgGetPOPKeyEncipherment performs an incorrect NULL check. 


*destKey is being allocated memory, but null check is being performed on destKey. It should be performed on *destKey instead.


3.16.3 version code:

*destKey = PORT_ZNew(CRMFPOPOPrivKey);
    if (destKey == NULL) {
       return SECFailure;
    }


Should be:

*destKey = PORT_ZNew(CRMFPOPOPrivKey);
    if (*destKey == NULL) {
        return SECFailure;
    }
Mentor: nelson, rrelyea, emaldona, wtc
Reminder for someone to check the bug and proposed patch.
(In reply to Nathan Yee [:nyee] from comment #1)
> Reminder for someone to check the bug and proposed patch.
(In reply to Nathan Yee [:nyee] from comment #1)
> Reminder for someone to check the bug and proposed patch.
Attachment #8460838 - Attachment is patch: true
Attachment #8460838 - Attachment mime type: text/x-patch → text/plain
Flags: needinfo?(kaie)
Flags: needinfo?(emaldona)
Mentor: emaldona, kaie, nelson, rrelyea, ryan.sleevi, wtc
Mentor: emaldona, kaie, nelson, rrelyea, ryan.sleevi, wtc
Mentor: gavin.sharp
Mentor: emaldona, gavin.sharp, kaie, nelson, rrelyea, ryan.sleevi, wtc
Attachment #8460838 - Flags: review?(rrelyea)
Comment on attachment 8460838 [details] [diff] [review]
Patch for the above raised bug

Review of attachment 8460838 [details] [diff] [review]:
-----------------------------------------------------------------

r+ rrelyea
Attachment #8460838 - Flags: review?(rrelyea) → review+
Keywords: checkin-needed
Flags: needinfo?(kaie)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(emaldona)
https://hg.mozilla.org/projects/nss/rev/791617b5572a
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 3.17
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: