null JSContext in native DOM image src attribution manipulation

VERIFIED FIXED in mozilla0.9.1

Status

()

VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: jud, Assigned: jud)

Tracking

({crash})

Trunk
mozilla0.9.1
x86
Windows 2000
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

18 years ago
null check failure is causing a crash when DOM image elements have their src 
attribute set from native cpp. the problem is that there is no JSContext on the 
stack when the window doesn't isn't a chrome window, or it doesn't contain JS 
content. 

you can get into this boat if you have a nsWebBrowser window, w/ out chrome, and 
you're playing w/ DOM elements. more specifically, disabling image loading for a 
window using nsIWebBrowserSetup.idl, then after the document loads, going back 
and re-setting the image elements to cause retro-active image loading.
(Assignee)

Updated

18 years ago
Keywords: crash
Target Milestone: --- → mozilla0.9.1
(Assignee)

Comment 1

18 years ago
Created attachment 35955 [details] [diff] [review]
check for null and gracefully fail.

Comment 2

18 years ago
Nice turn around, Jud.

The patch works for me.  

Thanks.

Comment 3

18 years ago
The code is fine, the comment I'd like to change:
1) This is an issue not only with calls from native code, but from any non-JS
language. Bottom-line we have JS-specific code in generic calling paths.
2) Whether a chrome window contains the content is not relevant in any way. I
guess I wasn't clear yesterday - the containing window has nothing to do with
the existence of a JS context on the stack.

Comment 4

18 years ago
Oh yeah, r/sr=vidur.
(Assignee)

Comment 5

18 years ago
Created attachment 35966 [details] [diff] [review]
updated patch to reflect vidur's comment changes.
a=blizzard for 0.9.1

Comment 7

18 years ago
r=jband
(Assignee)

Comment 8

18 years ago
fix is in.

Checking in nsHTMLImageElement.cpp;
/cvsroot/mozilla/content/html/content/src/nsHTMLImageElement.cpp,v  <-- 
nsHTMLImageElement.cpp
new revision: 1.86; previous revision: 1.85
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 9

18 years ago
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.