Changeset 98970 in webkit


Ignore:
Timestamp:
Nov 1, 2011, 9:28:18 AM (13 years ago)
Author:
Darin Adler
Message:

Crash in PDF code when script has illegal UTF-8 or UTF-16 sequences
https://bugs.webkit.org/show_bug.cgi?id=71289

Reviewed by Dan Bernstein.

Just adding a null check. I don't have access to an actual PDF with
this problem but crashes from the field indicate they exist.

  • WebView/WebPDFDocumentExtras.mm:

(allScriptsInPDFDocument): Skip the code to add the script text
to an array when the script is null.

Location:
trunk/Source/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r98769 r98970  
     12011-11-01  Darin Adler  <darin@apple.com>
     2
     3        Crash in PDF code when script has illegal UTF-8 or UTF-16 sequences
     4        https://bugs.webkit.org/show_bug.cgi?id=71289
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Just adding a null check. I don't have access to an actual PDF with
     9        this problem but crashes from the field indicate they exist.
     10
     11        * WebView/WebPDFDocumentExtras.mm:
     12        (allScriptsInPDFDocument): Skip the code to add the script text
     13        to an array when the script is null.
     14
    1152011-10-28  John Sullivan  <sullivan@apple.com>
    216
  • trunk/Source/WebKit/mac/WebView/WebPDFDocumentExtras.mm

    r95901 r98970  
    9090        return scripts;
    9191
    92     // The names are aribtrary. We are only interested in the values.
     92    // The names are arbitrary. We are only interested in the values.
    9393    Vector<CGPDFObjectRef> objects;
    9494    getAllValuesInPDFNameTree(javaScriptNameTree, objects);
     
    126126        NSStringEncoding encoding = (length > 1 && bytes[0] == 0xFE && bytes[1] == 0xFF) ? NSUnicodeStringEncoding : NSUTF8StringEncoding;
    127127        NSString *script = [[NSString alloc] initWithBytes:bytes length:length encoding:encoding];
     128        if (!script)
     129            continue;
     130
    128131        [scripts addObject:script];
    129132        [script release];
Note: See TracChangeset for help on using the changeset viewer.