Closed Bug 603816 Opened 14 years ago Closed 14 years ago

xpc::WrapperFactory::Rewrap assumes that all compartments have private data

Categories

(Core :: XPConnect, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status2.0 --- ?

People

(Reporter: mrbkap, Assigned: mrbkap)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

If either of the given compartments wasn't created by XPConnect, target->data will be null...

As of right now, we're the only consumer of JS_SetCompartmentPrivate; so a simple null check will suffice, but we might eventually need to mark the compartments themselves as being ours to avoid bad casts of other code's compartments' data.
Attached patch Proposed fixSplinter Review
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #482715 - Flags: review?(peterv)
Attachment #482715 - Flags: review?(peterv) → review+
http://hg.mozilla.org/tracemonkey/rev/962ccb277844

This fixes some of the crashtest orange.
status2.0: --- → ?
Whiteboard: fixed-in-tracemonkey
This bug doesn't have a test -- can that be addressed ASAP?
Not easily: the only way I know of doing this would be to create a binary component for the test.
http://hg.mozilla.org/mozilla-central/rev/962ccb277844
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.