Closed Bug 43347 Opened 25 years ago Closed 25 years ago

nsComponentManager doesn't check retval of PlatformInit(), can lead to crashes

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: madams, Assigned: rayw)

References

Details

(Keywords: crash, Whiteboard: [nsbeta3+])

xpcom/components/nsComponentManager doesn't check the return value of the PlatformInit() call. That method must complete successfully for the native component loader to be initialized, which otherwise leads to a crash. Patch: ------------------------------------------------------ Index: nsComponentManager.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/components/nsComponentManager.cpp,v retrieving revision 1.128 diff -u -r1.128 nsComponentManager.cpp --- nsComponentManager.cpp 2000/06/15 02:20:29 1.128 +++ nsComponentManager.cpp 2000/06/21 20:19:08 @@ -318,7 +318,13 @@ #ifdef USE_REGISTRY NR_StartupRegistry(); - PlatformInit(); + { + nsresult ret; + ret = PlatformInit(); + if( NS_FAILED( ret ) ) { + return ret; + } + } #endif PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS,
Adding crash keyword
Keywords: crash
Status: UNCONFIRMED → NEW
Ever confirmed: true
This fix should be applied fairly soon. While it does not stop mozilla from initializing correctly, it produces a messy crash instead of a nicer exit if something is wrong so that it cannot execute correctly.
Status: NEW → ASSIGNED
Target Milestone: --- → M18
Depends on: 46768
Adding nsbeta3 and patch keywords.
Keywords: nsbeta3, patch
Whiteboard: [nsbeta3+]
Applied the patch, exactly as given.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
please verify
Mark, can you mark Verified now?
QA Contact: leger → madams
You need to log in before you can comment on or make changes to this bug.