⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 136208 in webkit


Ignore:
Timestamp:
Nov 29, 2012, 11:58:33 PM (14 years ago)
Author:
timothy_horton@apple.com
Message:

PDFPlugin: Only plain text can be copied out of PDFs
​https://bugs.webkit.org/show_bug.cgi?id=103591
<rdar://problem/12555161>

Reviewed by Alexey Proskuryakov.

Don't write zero-length data to the pasteboard, just skip the item.

As mentioned in the comment, we don't expect this to come up, and would like to know if it does,
so we assert that it doesn't happen in debug builds.

  • WebProcess/Plugins/PDF/PDFPlugin.mm:

(WebKit::PDFPlugin::writeItemsToPasteboard):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r136207 r136208  
     12012-11-29  Tim Horton  <timothy_horton@apple.com>
     2
     3        PDFPlugin: Only plain text can be copied out of PDFs
     4        https://bugs.webkit.org/show_bug.cgi?id=103591
     5        <rdar://problem/12555161>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        Don't write zero-length data to the pasteboard, just skip the item.
     10
     11        As mentioned in the comment, we don't expect this to come up, and would like to know if it does,
     12        so we assert that it doesn't happen in debug builds.
     13
     14        * WebProcess/Plugins/PDF/PDFPlugin.mm:
     15        (WebKit::PDFPlugin::writeItemsToPasteboard):
     16
    1172012-11-29  Martin Robinson  <mrobinson@igalia.com>
    218
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm

    r136154 r136208  
    773773        NSData *data = [items objectAtIndex:i];
    774774
     775        // We don't expect the data for any items to be empty, but aren't completely sure.
     776        // Avoid crashing in the SharedMemory constructor in release builds if we're wrong.
     777        ASSERT(data.length);
     778        if (!data.length)
     779            continue;
     780
    775781        if ([type isEqualToString:NSStringPboardType] || [type isEqualToString:NSPasteboardTypeString]) {
    776782            RetainPtr<NSString> plainTextString(AdoptNS, [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
Note: See TracChangeset for help on using the changeset viewer.