Bug 393309: fix null deref crash for extension install requests that have no referer, r=Mossop (deputized by dveditz), a=blocking+
authorgavin@gavinsharp.com
Tue, 28 Aug 2007 08:30:48 -0700
changeset 5380 2a4cb3a7f070b4176db83365d80d34a698370c0e
parent 5379 a508d161b8d9f34fec97079b0387d2e8f1d6d976
child 5381 3b2b4ab739c8181b18ddd2a56dbc42426c58f287
push idunknown
push userunknown
push dateunknown
reviewersMossop, blocking
bugs393309
milestone1.9a8pre
Bug 393309: fix null deref crash for extension install requests that have no referer, r=Mossop (deputized by dveditz), a=blocking+
xpinstall/src/nsInstallTrigger.cpp
--- a/xpinstall/src/nsInstallTrigger.cpp
+++ b/xpinstall/src/nsInstallTrigger.cpp
@@ -204,17 +204,18 @@ nsInstallTrigger::HandleContent(const ch
         // contained the link
         //
         // NOTE: the XPI itself may be from elsewhere; the user can decide if
         // they trust the actual source when they get the install confirmation
         // dialog. The decision we're making here is whether the triggering
         // site is one which is allowed to annoy the user with modal dialogs.
 
         enabled = AllowInstall( referringURI );
-        referringURI->GetHost(host);
+        if (referringURI)
+            referringURI->GetHost(host);
     }
     else
     {
         // Now we're stumbing in the dark. In the most likely case the user
         // simply clicked on an FTP link (no referrer) and it's perfectly
         // sane to use the current window.
         //
         // On the other hand the user might be opening a non-http XPI link