Closed
Bug 334549
Opened 19 years ago
Closed 18 years ago
Fix for Coverty CID 179
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jonsmirl, Assigned: jonsmirl)
References
(Blocks 1 open bug, )
Details
(Keywords: coverity)
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
benjamin
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Event assign_zero: Variable "compMgr" assigned value 0. Event var_deref_model: Variable "compMgr" tracked as NULL was passed to a function that dereferences it. See the Coverity bugs at http://scan.coverity.com:7454/
It may be possible to rearrange this better but I'm not sure if it is ok to stomp nsComponentManagerImpl::gComponentManager when xpcom is initializaed.
Attachment #218894 -
Attachment is obsolete: true
Comment 4•19 years ago
|
||
Better to have public reference links, adding bonsai link to URL field. http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/xpcom/build/nsXPComInit.cpp&rev=1.243&mark=517-519,573#516 The "bug" Coverity found assumes NS_InitXPCOM* will be called multiple times (doing so looks like a bad idea, but there's no explicit check against it). The second time through gComponentManager will be set, compMgr remains null, and then it's dereferenced down on line 573. Some of the early returns in the "if (nsComponentManagerImpl::gComponentManager == NULL)" block leak the newly created component manager.
Updated•19 years ago
|
Attachment #218915 -
Flags: review?(benjamin)
Comment 5•19 years ago
|
||
Comment 4 was a description of the original problem, I mid-aired with the new patch and hadn't bothered to puzzle out what the first patch was doing. Looks like attachment 218915 [details] [diff] [review] fixes all the stuff I mentioned. A diff without the -w option would be good if you need someone else to check this in for you. (-w is great for reviews, not for checking in.)
Comment 7•19 years ago
|
||
Comment on attachment 218915 [details] [diff] [review] same change, diff easier to read It's not a real bug but we might as well "fix" it.
Attachment #218915 -
Flags: superreview?(darin)
Attachment #218915 -
Flags: review?(benjamin)
Attachment #218915 -
Flags: review+
Updated•18 years ago
|
Attachment #218915 -
Flags: superreview?(darin) → superreview+
Comment 8•18 years ago
|
||
Jon, if you want the patch to be checked in, you should ask someone to do it or add [checkin needed] to the whiteboard field of the bug (the first way is usually more effective).
Assignee: nobody → jonsmirl
Comment 9•18 years ago
|
||
/cvsroot/mozilla/xpcom/build/nsXPComInit.cpp,v <-- nsXPComInit.cpp new revision: 1.244; previous revision: 1.243
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: checkin needed
Updated•6 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•