From 0ad25da35b1a7413a728126102717415212ea584 Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Wed, 24 Jan 2024 10:01:22 +0000 Subject: [PATCH] Bug 1875118 - Add null checks to DefaultURI::EqualsExceptRef r=necko-reviewers,kershaw Differential Revision: https://phabricator.services.mozilla.com/D199474 --- netwerk/base/DefaultURI.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netwerk/base/DefaultURI.cpp b/netwerk/base/DefaultURI.cpp index c1462a6343ef..0a70218af5e8 100644 --- a/netwerk/base/DefaultURI.cpp +++ b/netwerk/base/DefaultURI.cpp @@ -215,6 +215,9 @@ NS_IMETHODIMP DefaultURI::GetRef(nsACString& aRef) { } NS_IMETHODIMP DefaultURI::EqualsExceptRef(nsIURI* other, bool* _retval) { + if (!_retval || !other) { + return NS_ERROR_NULL_POINTER; + } RefPtr otherUri; nsresult rv = other->QueryInterface(kDefaultURICID, getter_AddRefs(otherUri)); if (NS_FAILED(rv)) {