зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1720280: Avoid NullPtr deref in ImageBlocker::ShouldLoad. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132923
This commit is contained in:
Родитель
8cddf2911a
Коммит
42a0c93ddc
|
@ -20,12 +20,18 @@ ImageBlocker::ShouldLoad(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo,
|
|||
|
||||
*aShouldLoad = nsIContentPolicy::ACCEPT;
|
||||
|
||||
// we only want to check http, https, ftp
|
||||
if (!aContentLocation) {
|
||||
// Bug 1720280: Ideally we should block the load, but to avoid a potential
|
||||
// null pointer deref, we return early in this case. Please note that
|
||||
// the ImageBlocker only applies about http/https loads anyway.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// we only want to check http, https
|
||||
// for chrome:// and resources and others, no need to check.
|
||||
nsAutoCString scheme;
|
||||
aContentLocation->GetScheme(scheme);
|
||||
if (!scheme.LowerCaseEqualsLiteral("ftp") &&
|
||||
!scheme.LowerCaseEqualsLiteral("http") &&
|
||||
if (!scheme.LowerCaseEqualsLiteral("http") &&
|
||||
!scheme.LowerCaseEqualsLiteral("https")) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче