Changeset 58084 in webkit


Ignore:
Timestamp:
Apr 22, 2010 3:41:05 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-22 Anton Muhin <antonm@chromium.org>

Reviewed by Adam Barth.

[v8] Do not pass empty handle into SetHiddenValue which would crash.
https://bugs.webkit.org/show_bug.cgi?id=37801

  • bindings/v8/V8AbstractEventListener.cpp: (WebCore::V8AbstractEventListener::handleEvent): add couple of asserts to check for unexpected paths (WebCore::V8AbstractEventListener::invokeEventHandler): bail out of jsEvent is empty handle
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58078 r58084  
     12010-04-22  Anton Muhin  <antonm@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [v8] Do not pass empty handle into SetHiddenValue which would crash.
     6        https://bugs.webkit.org/show_bug.cgi?id=37801
     7
     8        * bindings/v8/V8AbstractEventListener.cpp:
     9        (WebCore::V8AbstractEventListener::handleEvent): add couple of asserts to check for unexpected paths
     10        (WebCore::V8AbstractEventListener::invokeEventHandler): bail out of jsEvent is empty handle
     11
    1122010-04-22  Stephan Aßmus  <superstippi@gmx.de>
    213
  • trunk/WebCore/bindings/v8/V8AbstractEventListener.cpp

    r56329 r58084  
    7272void V8AbstractEventListener::handleEvent(ScriptExecutionContext* context, Event* event)
    7373{
     74    ASSERT(event);
     75
    7476    // The callback function on XMLHttpRequest can clear the event listener and destroys 'this' object. Keep a local reference to it.
    7577    // See issue 889829.
     
    8789    // Get the V8 wrapper for the event object.
    8890    v8::Handle<v8::Value> jsEvent = toV8(event);
     91    ASSERT(!jsEvent.IsEmpty());
    8992
    9093    invokeEventHandler(context, event, jsEvent);
     
    115118void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context, Event* event, v8::Handle<v8::Value> jsEvent)
    116119{
     120    // If jsEvent is empty, attempt to set it as a hidden value would crash v8.
     121    if (jsEvent.IsEmpty())
     122        return;
    117123
    118124    v8::Local<v8::Context> v8Context = toV8Context(context, worldContext());
Note: See TracChangeset for help on using the changeset viewer.