Bug 941892 - Take an early return if nsPluginStreamListenerPeer gets passed an unknown stream. r=bsmedberg
authorJohn Schoenick <jschoenick@mozilla.com>
Fri, 22 Nov 2013 13:55:08 -0800
changeset 157630 c9ff42335f8a7859bdcce58c6b7d56a0227ed1fa
parent 157629 8a25ee567449a6bdbd7d041b1a69092cc0b6d810
child 157631 95f3ce0b7c96b20c28bf68dadb79cd467b6deef8
push id36794
push userjschoenick@mozilla.com
push dateWed, 27 Nov 2013 00:24:54 +0000
treeherdermozilla-inbound@c9ff42335f8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs941892
milestone28.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 941892 - Take an early return if nsPluginStreamListenerPeer gets passed an unknown stream. r=bsmedberg
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);