summaryrefslogtreecommitdiffstats
path: root/docshell/base/nsDocShell.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:02:01 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:02:01 +0200
commit2cb9f3ceb89038721eb9528dcc56dd33b66b0c85 (patch)
treeebd21481de50c193c390e29ad5ae3f6f0efeb6f9 /docshell/base/nsDocShell.cpp
parent6cb841b26e10af54559020b23a01ef93a639ac17 (diff)
downloadUXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.gz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.lz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.xz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.zip
Bug 1307736 - Ensure History loads pass valid triggeringPrincipal
Diffstat (limited to 'docshell/base/nsDocShell.cpp')
-rw-r--r--docshell/base/nsDocShell.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index be8cd6a8d..1a6099d7a 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -12660,12 +12660,11 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
srcdoc = NullString();
}
- // If there is no triggeringPrincipal we can fall back to using the
- // SystemPrincipal as the triggeringPrincipal for loading the history
- // entry, since the history entry can only end up in history if security
- // checks passed in the initial loading phase.
+ // If there is no valid triggeringPrincipal, we deny the load
+ MOZ_ASSERT(triggeringPrincipal,
+ "need a valid triggeringPrincipal to load from history");
if (!triggeringPrincipal) {
- triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
+ return NS_ERROR_FAILURE;
}
// Passing nullptr as aSourceDocShell gives the same behaviour as before