Changeset 163628 in webkit


Ignore:
Timestamp:
Feb 7, 2014 10:31:29 AM (10 years ago)
Author:
mitz@apple.com
Message:

[Cocoa] WKWebProcessPlugInNodeHandle methods leak and may crash
https://bugs.webkit.org/show_bug.cgi?id=128365

Reviewed by Anders Carlsson.

  • WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:

(+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]): Null-check the result
of InjectedBundleNodeHandle::getOrCreate, and autorelease the return value.
(-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]): Null-check the result of
InjectedBundleNodeHandle::htmlIFrameElementContentFrame, and autorelease the return value.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r163627 r163628  
     12014-02-07  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] WKWebProcessPlugInNodeHandle methods leak and may crash
     4        https://bugs.webkit.org/show_bug.cgi?id=128365
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
     9        (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]): Null-check the result
     10        of InjectedBundleNodeHandle::getOrCreate, and autorelease the return value.
     11        (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]): Null-check the result of
     12        InjectedBundleNodeHandle::htmlIFrameElementContentFrame, and autorelease the return value.
     13
    1142014-02-06  Brady Eidson  <beidson@apple.com>
    215
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm

    r163412 r163628  
    4949    JSObjectRef objectRef = JSValueToObject(contextRef, [value JSValueRef], 0);
    5050    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
     51    if (!nodeHandle)
     52        return nil;
    5153
    52     return wrapper(*nodeHandle.release().leakRef());
     54    return [wrapper(*nodeHandle.release().leakRef()) autorelease];
    5355}
    5456
     
    5658{
    5759    RefPtr<WebFrame> frame = _nodeHandle->htmlIFrameElementContentFrame();
    58     return wrapper(*frame.release().leakRef());
     60    if (!frame)
     61        return nil;
     62
     63    return [wrapper(*frame.release().leakRef()) autorelease];
    5964}
    6065
Note: See TracChangeset for help on using the changeset viewer.