Closed
Bug 884245
Opened 11 years ago
Closed 11 years ago
nsContentUtils::GetDocumentFromCaller() roots with a null context
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: jonco, Assigned: bholley)
References
Details
Attachments
(1 file, 1 obsolete file)
3.91 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
The following code is obviously bogus: 1670 nsIDocument* 1671 nsContentUtils::GetDocumentFromCaller() 1672 { 1673 JSContext *cx = nullptr; 1674 JS::Rooted<JSObject*> obj(cx);
Reporter | ||
Comment 1•11 years ago
|
||
Get the JSContext first via GetCurrentNativeCallContext()
Reporter | ||
Updated•11 years ago
|
Attachment #764076 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 764076 [details] [diff] [review] Proposed fix This isn't the fix we want. I'll attach a patch.
Attachment #764076 -
Attachment is obsolete: true
Attachment #764076 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Comment 3•11 years ago
|
||
The first three lines of this function are an obvious bug. But the behavior in general is also worrisome, because it's using antiquated XPConnect machinery that will be less and less correct as we move to the new DOM bindings. Let's just infer our global from the active compartment.
Attachment #764227 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•11 years ago
|
Assignee: jcoppeard → bobbyholley+bmo
Comment 4•11 years ago
|
||
Comment on attachment 764227 [details] [diff] [review] Simplify nsContentUtils::GetDocumentFromCaller. v1 r=me
Attachment #764227 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0452ad52421
Comment 6•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e0452ad52421
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•