Changeset 202754 in webkit


Ignore:
Timestamp:
Jul 1, 2016 1:52:30 PM (8 years ago)
Author:
Brent Fulgham
Message:

Prevent crash when attempting to copy an image
https://bugs.webkit.org/show_bug.cgi?id=159288
<rdar://problem/23507828>

Reviewed by Brady Eidson.

WebKit could crash if the HTMLImageElement had a null cachedImage member.
A little investigation showed that the URL we retrieve from the cachedImage
is never used, so rather than adding a null check, let's just pass a
default argument. The actual URL gets read from elsewhere in the pasteboard
processing code.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::performActionOnElement): Don't bother passing the
unused URL argument to the pasteboard method.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r202747 r202754  
     12016-07-01  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Prevent crash when attempting to copy an image
     4        https://bugs.webkit.org/show_bug.cgi?id=159288
     5        <rdar://problem/23507828>
     6
     7        Reviewed by Brady Eidson.
     8       
     9        WebKit could crash if the HTMLImageElement had a null cachedImage member.
     10        A little investigation showed that the URL we retrieve from the cachedImage
     11        is never used, so rather than adding a null check, let's just pass a
     12        default argument. The actual URL gets read from elsewhere in the pasteboard
     13        processing code.
     14
     15        * WebProcess/WebPage/ios/WebPageIOS.mm:
     16        (WebKit::WebPage::performActionOnElement): Don't bother passing the
     17        unused URL argument to the pasteboard method.
     18
    1192016-07-01  Brady Eidson  <beidson@apple.com>
    220
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r202347 r202754  
    24452445            Element* linkElement = containingLinkElement(&element);
    24462446            if (!linkElement)
    2447                 m_interactionNode->document().frame()->editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), element, downcast<RenderImage>(*element.renderer()).cachedImage()->url(), String());
     2447                m_interactionNode->document().frame()->editor().writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), element, URL(), String());
    24482448            else
    24492449                m_interactionNode->document().frame()->editor().copyURL(linkElement->document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkElement->fastGetAttribute(HTMLNames::hrefAttr))), linkElement->textContent());
Note: See TracChangeset for help on using the changeset viewer.