Bug 941892 - Take an early return if nsPluginStreamListenerPeer gets passed an unknown stream. r=bsmedberg, a=bajaj
authorJohn Schoenick <jschoenick@mozilla.com>
Fri, 22 Nov 2013 13:55:08 -0800
changeset 166657 e34cda9a452153970a785aaa0ed24103e4867113
parent 166656 9dc220412fa7aab1131eddfc86a7a9d0c23d4f38
child 166658 ffc179aca5b710aba686d7f960328604988e2553
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, bajaj
bugs941892
milestone27.0a2
Bug 941892 - Take an early return if nsPluginStreamListenerPeer gets passed an unknown stream. r=bsmedberg, a=bajaj
dom/plugins/base/nsPluginStreamListenerPeer.cpp
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -783,19 +783,21 @@ nsPluginStreamListenerPeer::UseExistingP
 }
 
 NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIRequest *request,
                                                           nsISupports* aContext,
                                                           nsIInputStream *aIStream,
                                                           uint64_t sourceOffset,
                                                           uint32_t aLength)
 {
-  NS_ASSERTION(mRequests.IndexOfObject(GetBaseRequest(request)) != -1,
-               "Received OnDataAvailable for untracked request.");
-  
+  if (mRequests.IndexOfObject(GetBaseRequest(request)) == -1) {
+    MOZ_ASSERT(false, "Received OnDataAvailable for untracked request.");
+    return NS_ERROR_UNEXPECTED;
+  }
+
   if (mRequestFailed)
     return NS_ERROR_FAILURE;
   
   if (mAbort) {
     uint32_t magicNumber = 0;  // set it to something that is not the magic number.
     nsCOMPtr<nsISupportsPRUint32> container = do_QueryInterface(aContext);
     if (container)
       container->GetData(&magicNumber);