Bug 1170676: Fix null dereference in PluginModuleParent::StreamCast; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Wed, 10 Jun 2015 11:08:46 -0600
changeset 248084 91bb0d44384a95a106dae714d9b6c5bb7d364a96
parent 248083 2a981c61aa56f94067d23d2861b18757d10c3e32
child 248085 58b09d4a5de5c89c6e317729024fdc4611d57891
push id28888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:29:45 +0000
treeherdermozilla-central@04c057942da4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1170676
milestone41.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 1170676: Fix null dereference in PluginModuleParent::StreamCast; r=jimm
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1817,17 +1817,17 @@ PluginModuleParent::StreamCast(NPP insta
 {
     PluginInstanceParent* ip = PluginInstanceParent::Cast(instance, aSurrogate);
     if (!ip || (aSurrogate && *aSurrogate && ip->UseSurrogate())) {
         return nullptr;
     }
 
     BrowserStreamParent* sp =
         static_cast<BrowserStreamParent*>(static_cast<AStream*>(s->pdata));
-    if (sp->mNPP != ip || s != sp->mStream) {
+    if (sp && (sp->mNPP != ip || s != sp->mStream)) {
         NS_RUNTIMEABORT("Corrupted plugin stream data.");
     }
     return sp;
 }
 
 bool
 PluginModuleParent::HasRequiredFunctions()
 {