Bug 546766 - Don't trust plugin return values for getvalue calls. r=bsmedberg.
authorJim Mathies <jmathies@mozilla.com>
Sat, 13 Mar 2010 17:57:53 -0600
changeset 39411 0ab4f3a39bb9094afe26c71a5c3260b1570c9ecc
parent 39410 99e20852ffe08e2eb36c8af8c05a7fa1ed333dc8
child 39412 0a6bdc7cb412ab2d5675962ab3fb822a655c4c82
push id12179
push userjmathies@mozilla.com
push dateSat, 13 Mar 2010 23:58:24 +0000
treeherdermozilla-central@0ab4f3a39bb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs546766
milestone1.9.3a3pre
Bug 546766 - Don't trust plugin return values for getvalue calls. r=bsmedberg.
dom/plugins/PluginInstanceChild.cpp
--- a/dom/plugins/PluginInstanceChild.cpp
+++ b/dom/plugins/PluginInstanceChild.cpp
@@ -388,17 +388,17 @@ PluginInstanceChild::AnswerNPP_GetValue_
 
 bool
 PluginInstanceChild::AnswerNPP_GetValue_NPPVpluginScriptableNPObject(
                                           PPluginScriptableObjectChild** aValue,
                                           NPError* aResult)
 {
     AssertPluginThread();
 
-    NPObject* object;
+    NPObject* object = nsnull;
     NPError result = NPERR_GENERIC_ERROR;
     if (mPluginIface->getvalue) {
         result = mPluginIface->getvalue(GetNPP(), NPPVpluginScriptableNPObject,
                                         &object);
     }
     if (result == NPERR_NO_ERROR && object) {
         PluginScriptableObjectChild* actor = GetActorForNPObject(object);
 
@@ -409,16 +409,19 @@ PluginInstanceChild::AnswerNPP_GetValue_
             *aValue = actor;
             *aResult = NPERR_NO_ERROR;
             return true;
         }
 
         NS_ERROR("Failed to get actor!");
         result = NPERR_GENERIC_ERROR;
     }
+    else {
+        result = NPERR_GENERIC_ERROR;
+    }
 
     *aValue = nsnull;
     *aResult = result;
     return true;
 }
 
 bool
 PluginInstanceChild::AnswerNPP_SetValue_NPNVprivateModeBool(const bool& value,