Title: [104226] branches/safari-534.54-branch/Source/WebKit/mac

Diff

Modified: branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog (104225 => 104226)


--- branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog	2012-01-05 22:39:10 UTC (rev 104225)
+++ branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog	2012-01-05 22:42:54 UTC (rev 104226)
@@ -1,3 +1,21 @@
+2011-1-5  Lucas Forschler  <[email protected]>
+
+    Merge 98970
+
+    2011-11-01  Darin Adler  <[email protected]>
+
+            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.
+
 2011-12-21  Oliver Hunt  <[email protected]>
 
     Merged _javascript_Core and related changes from r99898-r102985

Modified: branches/safari-534.54-branch/Source/WebKit/mac/WebView/WebPDFDocumentExtras.mm (104225 => 104226)


--- branches/safari-534.54-branch/Source/WebKit/mac/WebView/WebPDFDocumentExtras.mm	2012-01-05 22:39:10 UTC (rev 104225)
+++ branches/safari-534.54-branch/Source/WebKit/mac/WebView/WebPDFDocumentExtras.mm	2012-01-05 22:42:54 UTC (rev 104226)
@@ -89,7 +89,7 @@
     if (!CGPDFDictionaryGetDictionary(namesDictionary, "_javascript_", &_javascript_NameTree))
         return scripts;
 
-    // The names are aribtrary. We are only interested in the values.
+    // The names are arbitrary. We are only interested in the values.
     Vector<CGPDFObjectRef> objects;
     getAllValuesInPDFNameTree(_javascript_NameTree, objects);
     size_t objectCount = objects.size();
@@ -125,6 +125,9 @@
 
         NSStringEncoding encoding = (length > 1 && bytes[0] == 0xFE && bytes[1] == 0xFF) ? NSUnicodeStringEncoding : NSUTF8StringEncoding;
         NSString *script = [[NSString alloc] initWithBytes:bytes length:length encoding:encoding];
+        if (!script)
+            continue;
+
         [scripts addObject:script];
         [script release];
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to