Don't crash if NP_Initialize failed remotely: PluginLibrary::NP_Initialize returns an nsresult, not a NPError; nsNPAPIPlugin::CreatePlugin fails but still sets the outparam; nsPluginHost doesn't properly rv-check nsNPAPIPlugin::CreatePlugin, which causes us to think the bad plugin is actually good. I hate stupid failure chains!
This commit is contained in:
@@ -446,7 +446,7 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs
|
||||
mNPNIface = bFuncs;
|
||||
|
||||
if (!CallNP_Initialize(error)) {
|
||||
return NPERR_GENERIC_ERROR;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
else if (*error != NPERR_NO_ERROR) {
|
||||
return NS_OK;
|
||||
@@ -464,7 +464,7 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
|
||||
mNPNIface = bFuncs;
|
||||
|
||||
if (!CallNP_Initialize(error))
|
||||
return NPERR_GENERIC_ERROR;
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user