Closed Bug 3507 Opened 26 years ago Closed 26 years ago

Crash on error handling condition in nsAppRunner.cpp

Categories

(Core Graveyard :: Tracking, defect, P1)

All
Mac System 8.5

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sfraser_bugs, Assigned: rpotts)

Details

In main(), an error handling condition can lead to bad crashes, because use of 'goto' skips local initializers. E.g. say the NS_NewURL() call fails, so we 'goto done'. This skips the initializer for appCoresManager. But at done:, we try to shut down the appCoresManager, which was never initialized. This causes a crash.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
I checked in the fix.. It turns out that the variable in question was *never* initialized... If the code had actually been: nsIDOMAppCoresManager *appCoresManager = nsnull; then the compiler would have flagged it as an error! So, I guess the initialization was removed to avoid the error :-) The code was *actually*: nsIDOMAppCoresManager *appCoresManager; Oh well... I also made the error checking consistantly use the macros NS_SUCCEEDED(...) and NS_FAILED(...). These are actually *different* from saying rv != NS_OK (which is *not correct*) -- rick
Severity: normal → major
Priority: P2 → P1
Target Milestone: M3
sfraser, can you verify with Mar10 build and makr as so if all is well? Thanks!
Status: RESOLVED → VERIFIED
Looks good.
Moving all Apprunner bugs past and present to Other component temporarily whilst don and I set correct component. Apprunner component will be deleted/retired shortly.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.