diff options
author | Deepak Bhole <[email protected]> | 2011-04-18 11:36:52 -0400 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2011-04-18 11:36:52 -0400 |
commit | 7e0e2acfe9d490a1e5c6201665c145fb5b04dea3 (patch) | |
tree | 291ca403a6b956fc505cc2dac9c36251f4ad3da9 /plugin/icedteanp/IcedTeaNPPlugin.cc | |
parent | 600a1226a586f8c6f789379011edccef669d4766 (diff) |
Fixed RH691259: Midori sends a SIGSEGV with the IcedTea NP Plugin
Diffstat (limited to 'plugin/icedteanp/IcedTeaNPPlugin.cc')
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 0c37554..5ce3489 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -2009,14 +2009,12 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) { PLUGIN_DEBUG ("NP_Initialize\n"); - if (initialized) - return NPERR_NO_ERROR; - else if ((browserTable == NULL) || (pluginTable == NULL)) - { - PLUGIN_ERROR ("Browser or plugin function table is NULL."); + if ((browserTable == NULL) || (pluginTable == NULL)) + { + PLUGIN_ERROR ("Browser or plugin function table is NULL."); - return NPERR_INVALID_FUNCTABLE_ERROR; - } + return NPERR_INVALID_FUNCTABLE_ERROR; + } // Ensure that the major version of the plugin API that the browser // expects is not more recent than the major version of the API that @@ -2123,6 +2121,12 @@ NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); #endif + // Re-setting the above tables multiple times is OK (as the + // browser may change its function locations). However + // anything beyond this point should only run once. + if (initialized) + return NPERR_NO_ERROR; + // Make sure the plugin data directory exists, creating it if // necessary. data_directory = g_strconcat (P_tmpdir, NULL); |