Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=ritu
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 19 Aug 2015 18:26:13 +0100
changeset 289000 e975c8dbdb1832a034a9b8dd2aafb4d52201b81d
parent 288999 98983a6fd50d6eb8166116c12d980694be24101e
child 289001 6714dfb68afbc997ba0eeb5c6c83e86e672bc58d
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, ritu
bugs1192350
milestone42.0a2
Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=ritu
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1962,16 +1962,22 @@ XMLHttpRequest::Open(const nsACString& a
     if (!--mProxy->mOpenCount) {
       ReleaseProxy();
     }
 
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
+  // We have been released in one of the nested Open() calls.
+  if (!mProxy) {
+    aRv.Throw(NS_ERROR_FAILURE);
+    return;
+  }
+
   --mProxy->mOpenCount;
   mProxy->mIsSyncXHR = !aAsync;
 }
 
 void
 XMLHttpRequest::SetRequestHeader(const nsACString& aHeader,
                                  const nsACString& aValue, ErrorResult& aRv)
 {