Changeset 38184 in webkit


Ignore:
Timestamp:
Nov 6, 2008 10:41:18 AM (15 years ago)
Author:
alp@webkit.org
Message:

2008-11-06 Alp Toker <alp@nuanti.com>

Reviewed by Cameron Zwarich.

https://bugs.webkit.org/show_bug.cgi?id=22067
[GTK] Sun Java plugin segfaults at PluginPackage::createPackage()

null-check symbols loaded from plugin modules, initialize the function
table (like Win already does) and update it with the latest
additions. Adjust whitespace for easy diff'ing with the Win port code
from which it was forked.

This fixes crashes with libnspr4.so and any other plugins that don't
provide the symbols we expect.

  • plugins/gtk/PluginPackageGtk.cpp: (WebCore::PluginPackage::fetchInfo): (WebCore::PluginPackage::load):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38183 r38184  
     12008-11-06  Alp Toker  <alp@nuanti.com>
     2
     3        Reviewed by Cameron Zwarich.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=22067
     6        [GTK] Sun Java plugin segfaults at PluginPackage::createPackage()
     7
     8        null-check symbols loaded from plugin modules, initialize the function
     9        table (like Win already does) and update it with the latest
     10        additions. Adjust whitespace for easy diff'ing with the Win port code
     11        from which it was forked.
     12
     13        This fixes crashes with libnspr4.so and any other plugins that don't
     14        provide the symbols we expect.
     15
     16        * plugins/gtk/PluginPackageGtk.cpp:
     17        (WebCore::PluginPackage::fetchInfo):
     18        (WebCore::PluginPackage::load):
     19
    1202008-11-06  Kristian Amlie  <kristian.amlie@nokia.com>
    221
  • trunk/WebCore/plugins/gtk/PluginPackageGtk.cpp

    r38123 r38184  
    8787        return false;
    8888
    89     NP_GetMIMEDescriptionFuncPtr NP_GetMIMEDescription;
    90     NPP_GetValueProcPtr NPP_GetValue;
     89    NP_GetMIMEDescriptionFuncPtr NP_GetMIMEDescription = 0;
     90    NPP_GetValueProcPtr NPP_GetValue = 0;
    9191
    9292    g_module_symbol(m_module, "NP_GetMIMEDescription", (void**)&NP_GetMIMEDescription);
    9393    g_module_symbol(m_module, "NP_GetValue", (void**)&NPP_GetValue);
     94
     95    if (!NP_GetMIMEDescription || !NPP_GetValue)
     96        return false;
    9497
    9598    char* buffer = 0;
     
    153156    m_isLoaded = true;
    154157
    155     NP_InitializeFuncPtr NP_Initialize;
     158    NP_InitializeFuncPtr NP_Initialize = 0;
     159    m_NPP_Shutdown = 0;
     160
    156161    NPError npErr;
    157162
     
    165170    m_pluginFuncs.size = sizeof(m_pluginFuncs);
    166171
     172    memset(&m_browserFuncs, 0, sizeof(m_browserFuncs));
    167173    m_browserFuncs.size = sizeof (m_browserFuncs);
    168174    m_browserFuncs.version = NP_VERSION_MINOR;
     175
    169176    m_browserFuncs.geturl = NPN_GetURL;
    170177    m_browserFuncs.posturl = NPN_PostURL;
     
    190197    m_browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
    191198    m_browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
     199    m_browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
    192200
    193201    m_browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue;
     
    197205    m_browserFuncs.identifierisstring = _NPN_IdentifierIsString;
    198206    m_browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier;
     207    m_browserFuncs.intfromidentifier = _NPN_IntFromIdentifier;
    199208    m_browserFuncs.createobject = _NPN_CreateObject;
    200209    m_browserFuncs.retainobject = _NPN_RetainObject;
Note: See TracChangeset for help on using the changeset viewer.