Bug 1170676 - Fix null dereference in PluginModuleParent::StreamCast. r=jimm, a=lizzard
authorAaron Klotz <aklotz@mozilla.com>
Wed, 10 Jun 2015 11:08:46 -0600
changeset 266241 b41419fa52bb
parent 266240 71ce4845c6f6
child 266242 ad1f0e1ddaf2
push id4796
push userryanvm@gmail.com
push date2015-06-11 16:30 +0000
treeherdermozilla-beta@ad1f0e1ddaf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, lizzard
bugs1170676
milestone39.0
Bug 1170676 - Fix null dereference in PluginModuleParent::StreamCast. r=jimm, a=lizzard
dom/plugins/ipc/PluginModuleParent.cpp
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1784,17 +1784,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()
 {