From 52d02ac527c3e3930e0b82fc8c4e0c348fa31625 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 13 Aug 2019 21:00:31 +0000 Subject: [PATCH] Bug 1573590. Make sure we're in the right compartment before serializing our stack in worker error reporting. r=bhackett Nothing guarantees that the current compartment of aCx matches the compartment where the exception was thrown. Differential Revision: https://phabricator.services.mozilla.com/D41791 --HG-- extra : moz-landing-system : lando --- dom/workers/WorkerPrivate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 8db98a591592..50fad60b2546 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -4134,6 +4134,7 @@ void WorkerPrivate::ReportError(JSContext* aCx, &stackGlobal); if (stack) { + JSAutoRealm ar(aCx, stackGlobal); report->SerializeWorkerStack(aCx, this, stack); }