Closed Bug 605264 Opened 15 years ago Closed 15 years ago

Crash [@ strcmp | nsHTMLMediaElement::Observe] with QI to nsIObserver

Categories

(Core :: Audio/Video, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla2.0b12
Tracking Status
blocking2.0 --- final+

People

(Reporter: jruderman, Assigned: khuey)

References

Details

(Keywords: crash, testcase, Whiteboard: [softblocker])

Crash Data

Attachments

(4 files)

2400 nsresult nsHTMLMediaElement::Observe(nsISupports* aSubject, 2401 const char* aTopic, const PRUnichar* aData) 2402 { 2403 if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) { aTopic is null.
Breakpad can't handle this crash :(
Assignee: nobody → khuey
Attached file gdb output
Nominating -- the incomplete stacks for this bug force me to over-ignore when fuzzing, and this won't be fixed by bug 605271 in time for Firefox 4.
blocking2.0: --- → ?
Comment on attachment 503030 [details] [diff] [review] Stop script from calling nsHTMLMediaElement::Observe. This is ugly, but it gets the job done. Is getting XPConnect at xpcom-shutdown safe? I doubt we have test code in the tree to exercise this at xpcom-shutdown.
Attachment #503030 - Flags: review?(jst)
Comment on attachment 503030 [details] [diff] [review] Stop script from calling nsHTMLMediaElement::Observe. - In nsHTMLMediaElement::Observe(): + // Since this is exposed to (malicious) JS, verify that we aren't being + // called from script. We only have to worry about being called directly, + // so this is safe. + nsAXPCNativeCallContext* ncc = nsnull; + nsContentUtils::XPConnect()->GetCurrentNativeCallContext(&ncc); + if (ncc) + return NS_ERROR_FAILURE; How about doing what nsImageLoadingContent does in cases like this, which is to call nsContentUtils::IsCallerChrome(), which I believe is shutdown safe. I suspect your version is as well, but I can't say with 100% certainty. r=jst with that.
Attachment #503030 - Flags: review?(jst) → review+
Made changes suggested by jst and pushed. http://hg.mozilla.org/mozilla-central/rev/652d012f9dc8
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b12
Status: RESOLVED → VERIFIED
Crash Signature: [@ strcmp | nsHTMLMediaElement::Observe]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: