Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp

Issue 2358993003: Service worker creation from <link> leads to nullptr dereference (Closed)
Patch Set: Formatting Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
index b47a8652bab7238b03bf66639f634b1ad922c7c0..19c24001af095b98347f753987327e33cb245f2c 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp
@@ -60,6 +60,8 @@ ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(LocalFrame* frame,
if (frame && !frame->securityContext()->getSecurityOrigin()->canAccessServiceWorkers()) {
if (frame->securityContext()->isSandboxed(SandboxOrigin))
exceptionState.throwSecurityError("Service worker is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag.");
+ else if (frame->securityContext()->getSecurityOrigin()->hasSuborigin())
+ exceptionState.throwSecurityError("Service worker is disabled because the context is in a suborigin.");
else
exceptionState.throwSecurityError("Access to service workers is denied in this document origin.");
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698