Closed Bug 211384 Opened 21 years ago Closed 21 years ago

Importing a CRL that already exists in the DB causes NSS_Shutdown to fail

Categories

(NSS :: Libraries, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tejbiz, Assigned: wtc)

Details

(Whiteboard: [3.8.2])

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
Build Identifier: 

Import a CRL using crlutil. exit code is 0.
Import the same CRL again. exit code is 1, because NSS_Shutdown failed.
NSS_Shutdown fails because secmod_PrivateModuleCount does not
come down to 0 (it is 1 at the end).

I'll attach a CRL that can be used. 
Using NSS_3_8_RTM, NSPR_4_3_RTM

Use the following procedure to reproduce problem.

certutil -N -d .
crlutil -I -i crl.der -d . -B (check ret code "echo $?" - 0)
crlutil -I -i crl.der -d . -B (check ret code "echo $?" - 1)

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
DER CRL for reproducing the problem
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → 3.9
Version: unspecified → 3.8
Attached patch Proposed patchSplinter Review
The actual fix for the bug Tej reported is in crl.c,
where we should not obtain a slot reference because
PK11_FindCrlByName already obtained a slot reference.

The changes to pk11cert.c are mostly code cleanup: I
handle the failure of PORT_Strdup and set *url to NULL
if crl->url is NULL.  I also fixed a slot reference
leak if the SECITEM_AllocItem call fails.  We should
obtain a slot reference only when the PK11_FindCrlByName
function returns successfully.

Tej, could you verify that this patch fixes the bug?
Nelson, could you review this patch?
verified that the patch fixes the problem
Comment on attachment 126955 [details] [diff] [review]
Proposed patch

r=nelsonb
Attachment #126955 - Flags: review+
Fix checked into the NSS trunk (NSS 3.9).

Since the bug prevents user profile switching in NSS-based
client applications, I also checked in the fix on the
NSS_3_8_BRANCH (NSS 3.8.2) and NSS_CLIENT_TAG (Mozilla 1.5a).
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Whiteboard: [3.8.2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: