mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1779521 - Check for null principal when drawing images to a canvas element. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D151819
This commit is contained in:
parent
5e791d5c28
commit
e304a056df
@ -244,7 +244,11 @@ void DoDrawImageSecurityCheck(dom::HTMLCanvasElement* aCanvasElement,
|
||||
// No need to do a security check if the image used CORS for the load
|
||||
if (CORSUsed) return;
|
||||
|
||||
MOZ_ASSERT(aPrincipal, "Must have a principal here");
|
||||
if (NS_WARN_IF(!aPrincipal)) {
|
||||
MOZ_ASSERT_UNREACHABLE("Must have a principal here");
|
||||
aCanvasElement->SetWriteOnly();
|
||||
return;
|
||||
}
|
||||
|
||||
if (aCanvasElement->NodePrincipal()->Subsumes(aPrincipal)) {
|
||||
// This canvas has access to that image anyway
|
||||
|
Loading…
Reference in New Issue
Block a user