Closed Bug 82536 Opened 25 years ago Closed 25 years ago

null JSContext in native DOM image src attribution manipulation

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: jud, Assigned: jud)

Details

(Keywords: crash)

Attachments

(2 files)

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.
Keywords: crash
Target Milestone: --- → mozilla0.9.1
Nice turn around, Jud. The patch works for me. Thanks.
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.
Oh yeah, r/sr=vidur.
a=blizzard for 0.9.1
r=jband
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
Closed: 25 years ago
Resolution: --- → FIXED
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: