Changeset 90148 in webkit


Ignore:
Timestamp:
Jun 30, 2011 12:31:01 PM (13 years ago)
Author:
Martin Robinson
Message:

2011-06-30 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] Crash observed with nspluginwrapper and flash
https://bugs.webkit.org/show_bug.cgi?id=62249

Added a test which verifies that WebKit does not crash when InvalidateRect
is called with a null instance.

  • platform/gtk/plugins/invalidate-rect-with-null-npp-argument-expected.txt: Added.
  • platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html: Added.

2011-06-30 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] Crash observed with nspluginwrapper and flash
https://bugs.webkit.org/show_bug.cgi?id=62249

Test: plugins/invalidate-rect-with-null-npp-argument.html

  • plugins/npapi.cpp: (NPN_InvalidateRect): Guard against null instances here.

2011-06-30 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] Crash observed with nspluginwrapper and flash
https://bugs.webkit.org/show_bug.cgi?id=62249

  • WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_InvalidateRect): Guard against null instances here.

2011-06-30 Martin Robinson <mrobinson@igalia.com>

Reviewed by Anders Carlsson.

[GTK] Crash observed with nspluginwrapper and flash
https://bugs.webkit.org/show_bug.cgi?id=62249

Added a TestNetscapePlugin test which verifies that WebKit properly
handles situations where InvalidateRect is called with a null instance.

  • DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp: Added. (CallInvalidateRectWithNullNPPArgument::CallInvalidateRectWithNullNPPArgument): (CallInvalidateRectWithNullNPPArgument::NPP_New):
  • GNUmakefile.am: Add the new file to sources list.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90139 r90148  
     12011-06-30  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] Crash observed with nspluginwrapper and flash
     6        https://bugs.webkit.org/show_bug.cgi?id=62249
     7
     8        Added a test which verifies that WebKit does not crash when InvalidateRect
     9        is called with a null instance.
     10
     11        * platform/gtk/plugins/invalidate-rect-with-null-npp-argument-expected.txt: Added.
     12        * platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html: Added.
     13
    1142011-06-30  Tab Atkins  <jackalmage@gmail.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r90144 r90148  
     12011-06-30  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] Crash observed with nspluginwrapper and flash
     6        https://bugs.webkit.org/show_bug.cgi?id=62249
     7
     8        Test: plugins/invalidate-rect-with-null-npp-argument.html
     9
     10        * plugins/npapi.cpp:
     11        (NPN_InvalidateRect): Guard against null instances here.
     12
    1132011-06-30  Levi Weintraub  <leviw@chromium.org>
    214
  • trunk/Source/WebCore/plugins/npapi.cpp

    r83957 r90148  
    122122void NPN_InvalidateRect(NPP instance, NPRect* invalidRect)
    123123{
    124     pluginViewForInstance(instance)->invalidateRect(invalidRect);
     124    PluginView* view = pluginViewForInstance(instance);
     125#if defined(TARGET_X11)
     126    // NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
     127    // on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
     128    if (!view)
     129        return;
     130#endif
     131    view->invalidateRect(invalidRect);
    125132}
    126133
  • trunk/Source/WebKit2/ChangeLog

    r90133 r90148  
     12011-06-30  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] Crash observed with nspluginwrapper and flash
     6        https://bugs.webkit.org/show_bug.cgi?id=62249
     7
     8        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
     9        (WebKit::NPN_InvalidateRect): Guard against null instances here.
     10
    1112011-06-30  Mark Rowe  <mrowe@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp

    r89537 r90148  
    594594static void NPN_InvalidateRect(NPP npp, NPRect* invalidRect)
    595595{
     596#if PLUGIN_ARCHITECTURE(X11)
     597    // NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
     598    // on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
     599    if (!npp)
     600        return;
     601#endif
    596602    RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
    597603    plugin->invalidate(invalidRect);
  • trunk/Tools/ChangeLog

    r90140 r90148  
     12011-06-30  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [GTK] Crash observed with nspluginwrapper and flash
     6        https://bugs.webkit.org/show_bug.cgi?id=62249
     7
     8        Added a TestNetscapePlugin test which verifies that WebKit properly
     9        handles situations where InvalidateRect is called with a null instance.
     10
     11        * DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp: Added.
     12        (CallInvalidateRectWithNullNPPArgument::CallInvalidateRectWithNullNPPArgument):
     13        (CallInvalidateRectWithNullNPPArgument::NPP_New):
     14        * GNUmakefile.am: Add the new file to sources list.
     15
    1162011-06-30  Eric Seidel  <eric@webkit.org>
    217
  • trunk/Tools/GNUmakefile.am

    r89503 r90148  
    255255        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp \
    256256        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \
     257        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp \
    257258        Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
    258259        Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h \
Note: See TracChangeset for help on using the changeset viewer.