Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=mahe
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 19 Aug 2015 18:26:13 +0100
changeset 238791 8c482fd901417648e7a53f7e140ae10f31d0beb2
parent 238790 16d864d163deb9154ead5edb2b20627ffc011b4d
child 238792 ad8ca591beceffe74dcdd20cb9a90ea9b9dcc55d
push id787
push userryanvm@gmail.com
push dateTue, 01 Sep 2015 02:36:18 +0000
treeherdermozilla-b2g37_v2_2@ad8ca591bece [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, mahe
bugs1192350
milestone37.0
Bug 1192350 - XMLHttpRequest::Open() should check if mProxy has been already released in a nested ::Open() calls. r=khuey, a=mahe
dom/workers/XMLHttpRequest.cpp
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1953,16 +1953,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)
 {