Closed
Bug 88230
Opened 24 years ago
Closed 24 years ago
nsNSSComponent will crash is called when unitialized
Categories
(Core Graveyard :: Security: UI, defect, P1)
Tracking
(Not tracked)
VERIFIED
FIXED
psm2.1
People
(Reporter: ccarlen, Assigned: javi)
References
Details
Attachments
(3 files)
1.24 KB,
patch
|
Details | Diff | Splinter Review | |
1.37 KB,
patch
|
Details | Diff | Splinter Review | |
1.37 KB,
patch
|
Details | Diff | Splinter Review |
I came across this in working on bug 86021 . It uses profile switching, to
which the NSSComponent listens, to do the job. Problem is, the profile mgr
window needs to be brought up after NSS has been shut down but before is has
been restarted. See
http://lxr.mozilla.org/mozilla/source/security/manager/ssl/src/nsNSSComponent.cpp#746
. During this time at which it's unitialized, mouse movement will cause
RandomUpdate to be called and kaboom. So, the simple patch here checks the state
of mNSSInitilized before calling it. Then I noticed something really odd: that
flag is only set after a profile change but never in the normal couse of things.
Notice how in the destructor, it checks that flag before calling NSS_Shutdown.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
This bit:
+ nsCOMPtr<nsIObserverService>
observerService(do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv));
has nothing to do with the problem reported here. I just noticed that the method
was returning an uninitialized rv :-/
Assignee | ||
Comment 3•24 years ago
|
||
Updating version and adding to cc list.
Target Milestone: --- → 2.1
Version: 1.01 → 2.0
Assignee | ||
Comment 4•24 years ago
|
||
I'd rather move this block:
-
+
+ mNSSInitialized = PR_TRUE;
to the end of the method. That way it will only be set if all initialization
succeeded. Other than that, patch looks good.
Reporter | ||
Comment 5•24 years ago
|
||
Javi - I wasn't sure about that myself. Say it fails and we don't set the flag
so we then try again - is that safe?
Assignee | ||
Comment 6•24 years ago
|
||
If we set the flag at the beginning and fail, then the very next time we try to
initialize NSS the very first check in the method will cause an error and that
means NSS will never be initialized.
But after looking at the code, it seems that we just waltz through, so the patch
will work for now, but if we ever (ahem) add error checking past that point,
then we could run into problems.
Bottom line, today that won't cause a problem, but if we modify the code one day
to do more error checking, then we run the risk of missing the fact that we'd
have to move the initialization of mNSSInitialized.
Updated•24 years ago
|
Keywords: nsenterprise
Priority: -- → P1
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
Reporter | ||
Comment 9•24 years ago
|
||
Thanks, Javi. Problem is, I can't check this one because it's not part of
SeaMonkeyAll. Can you do this?
Comment 10•24 years ago
|
||
sr=tor
Assignee | ||
Comment 11•24 years ago
|
||
Patch checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•