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 267703 b41419fa52bbcb8221316cf252350f06241cd104
parent 267702 71ce4845c6f6f157198e888cce005b42a55726fa
child 267704 ad1f0e1ddaf2379da90915ceaf359a6a6aee912f
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [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()
 {