bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Need null ptr check in nsDocShell::SetupNewViewer

RESOLVED FIXED

Status

()

Core
Document Navigation
P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: John Bandhauer, Assigned: John Bandhauer)

Tracking

({crash})

Trunk
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

18 years ago
I saw a crash from a call to GetMainWidget in nsDocShell::SetupNewViewer that 
does not check the resulting pointer for null. This pointer is later passed into 
code that later crashes.

I've only seen this crash once. I can't repeat it.

Does anyone actually *own* nsDocShell.cpp?

I'll attach a stack and proposed fix (which assumes that early failure after 
call to GetMainWidget is best).
(Assignee)

Comment 1

18 years ago
Created attachment 18821 [details]
stack at crash
(Assignee)

Comment 2

18 years ago
Created attachment 18822 [details] [diff] [review]
proposed fix to check pointer early

Comment 3

18 years ago
sspitzer thought this was adam lock's module
Assignee: asa → adamlock
Component: Browser-General → XP Apps
Keywords: approval, crash, patch, review
QA Contact: doronr → sairuh
over to docshell.
Component: XP Apps → Embedding: Docshell
QA Contact: sairuh → adamlock

Comment 5

18 years ago
I'm the nominal owner of this module :)

The patch looks good to me so r=adamlock. Reassigning to jband.
Assignee: adamlock → jband

Comment 6

18 years ago
NS_ERROR("foo") is the somewhat less verbose equivalent to NS_ASSERTION(0,
"foo"). You can change it if you want, the basic idea looks fine. sr=waterson
(Assignee)

Comment 7

18 years ago
checked into trunk
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.