summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-08-30 17:46:49 +0200
committerMoonchild <moonchild@palemoon.org>2023-08-30 17:46:49 +0200
commitca691c8d2dbd00957722028b5bc8322721879d86 (patch)
tree3516b57876fe785de62c444d684050c37999a728
parent226f97e2f44b1bb2a9ad602fd7f5ef2c5a0dd5ac (diff)
downloaduxp-ca691c8d2dbd00957722028b5bc8322721879d86.tar.gz
[DOM] Deny web notifications if principal can't resolve.
-rw-r--r--dom/notification/Notification.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp
index 9a7c833794..5439a4fe59 100644
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -1688,6 +1688,11 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv)
}
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
+ if (!principal) {
+ aRv.Throw(NS_ERROR_UNEXPECTED);
+ return NotificationPermission::Denied;
+ }
+
return GetPermissionInternal(principal, aRv);
}