forked from mirrors/gecko-dev
Bug 1507055 - AntiTrackingCommon::RedirectHeuristic must check the number of redirect entries, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D60505 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f97dcc5818
commit
b9bec0df94
1 changed files with 1 additions and 2 deletions
|
|
@ -2372,10 +2372,9 @@ void AntiTrackingCommon::RedirectHeuristic(nsIChannel* aOldChannel,
|
|||
nsCOMPtr<nsIPrincipal> trackingPrincipal;
|
||||
nsCOMPtr<nsIURI> trackingURI;
|
||||
|
||||
if (allowedByPreviousRedirect) {
|
||||
if (allowedByPreviousRedirect && !chain.IsEmpty()) {
|
||||
const nsTArray<nsCOMPtr<nsIRedirectHistoryEntry>>& chain =
|
||||
oldLoadInfo->RedirectChain();
|
||||
MOZ_ASSERT(chain.Length() > 0);
|
||||
rv = chain[0]->GetPrincipal(getter_AddRefs(trackingPrincipal));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
LOG(("Can't obtain the principal from the redirect chain"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue