Bug 1033295 - Crash in nsWindowDataSource::GetWindowForResource. r=bsmedberg
authorSteven Michaud <smichaud@pobox.com>
Tue, 15 Jul 2014 12:03:21 -0500
changeset 216108 b62115e8c780b36b9883453d9029b3d6c4145030
parent 216107 d0050ba0b87592b01ccfd4227ff8057ddffacc3b
child 216109 3192a23f08848103ede74607581c4f1d0fb7e2c2
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1033295
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1033295 - Crash in nsWindowDataSource::GetWindowForResource. r=bsmedberg
xpfe/components/windowds/nsWindowDataSource.cpp
--- a/xpfe/components/windowds/nsWindowDataSource.cpp
+++ b/xpfe/components/windowds/nsWindowDataSource.cpp
@@ -287,16 +287,20 @@ findWindow(nsIXULWindow* aWindow, nsIRDF
 }
 
 // nsIWindowDataSource implementation
 
 NS_IMETHODIMP
 nsWindowDataSource::GetWindowForResource(const char *aResourceString,
                                          nsIDOMWindow** aResult)
 {
+    if (NS_WARN_IF(!aResourceString)) {
+        return NS_ERROR_INVALID_ARG;
+    }
+
     nsCOMPtr<nsIRDFResource> windowResource;
     gRDFService->GetResource(nsDependentCString(aResourceString),
                              getter_AddRefs(windowResource));
 
     // now reverse-lookup in the hashtable
     findWindowClosure closure = { windowResource.get(), nullptr };
     mWindowResources.EnumerateRead(findWindow, &closure);
     if (closure.resultWindow) {