From 1f4b858be257da8213b9769fd63eec8d74b64cdf Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 2 Jul 2024 22:07:39 +0200 Subject: [PATCH] Issue #2542 - Part 1b: Fix dom.securecontext.whitelist code issues Some minor bugfixes (wrong condition and string type) --- dom/security/nsMixedContentBlocker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 4ba7a20b93..083c994ea2 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -393,10 +393,10 @@ bool nsMixedContentBlocker::IsPotentiallyTrustworthyOrigin(nsIURI* aURI) { } nsAdoptingCString whitelist = Preferences::GetCString("dom.securecontext.whitelist"); - if (NS_SUCCEEDED(rv)) { + if (whitelist) { nsCCharSeparatedTokenizer tokenizer(whitelist, ','); while (tokenizer.hasMoreTokens()) { - const nsACString& allowedHost = tokenizer.nextToken(); + const nsCSubstring& allowedHost = tokenizer.nextToken(); if (host.Equals(allowedHost)) { return true; }