Bug 1307736 - Ensure History loads pass valid triggeringPrincipal. r=bz

This commit is contained in:
Christoph Kerschbaumer
2017-01-27 11:19:13 +01:00
parent 90510ed55e
commit d161cb85e1
2 changed files with 11 additions and 5 deletions

View File

@@ -12587,12 +12587,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