Bug 1130747: Add more error checking to PluginAsyncSurrogate::GetPropertyHelper; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Sun, 08 Feb 2015 19:42:08 -0700
changeset 241839 3f53cf53a34eb7a69a0d9456740d44f3b68d882a
parent 241838 f6795c8f0f31effeb134ceb9995eb983884087ca
child 241840 bc3240e8a37dd1932a32fab4fef32d66c2548db4
push id624
push userdburns@mozilla.com
push dateTue, 10 Feb 2015 13:30:25 +0000
reviewersjimm
bugs1130747
milestone38.0a1
Bug 1130747: Add more error checking to PluginAsyncSurrogate::GetPropertyHelper; r=jimm
dom/plugins/ipc/PluginAsyncSurrogate.cpp
--- a/dom/plugins/ipc/PluginAsyncSurrogate.cpp
+++ b/dom/plugins/ipc/PluginAsyncSurrogate.cpp
@@ -598,20 +598,25 @@ PluginAsyncSurrogate::GetPropertyHelper(
     return false;
   }
 
   RecursionGuard guard;
   if (guard.IsRecursive()) {
     return false;
   }
 
-  WaitForInit();
+  if (!WaitForInit()) {
+    return false;
+  }
 
   AsyncNPObject* object = static_cast<AsyncNPObject*>(aObject);
   NPObject* realObject = object->GetRealObject();
+  if (!realObject) {
+    return false;
+  }
   if (realObject->_class != PluginScriptableObjectParent::GetClass()) {
     NS_ERROR("Don't know what kind of object this is!");
     return false;
   }
 
   PluginScriptableObjectParent* actor =
     static_cast<ParentNPObject*>(realObject)->parent;
   bool success = actor->GetPropertyHelper(aName, aHasProperty, aHasMethod, aResult);