Title: [140442] trunk/Tools
Revision
140442
Author
jer.no...@apple.com
Date
2013-01-22 11:13:58 -0800 (Tue, 22 Jan 2013)

Log Message

REGRESSION(r140344): Repeated crashes in WKTR PlatformWebView::viewSupportsOptions().
https://bugs.webkit.org/show_bug.cgi?id=107562

Rubber-stamped by Alexy Proskuryakov.

The input to WKBooleanGetValue() is not NULL-safe, so NULL check its inputs before calling.

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (140441 => 140442)


--- trunk/Tools/ChangeLog	2013-01-22 19:12:15 UTC (rev 140441)
+++ trunk/Tools/ChangeLog	2013-01-22 19:13:58 UTC (rev 140442)
@@ -1,3 +1,16 @@
+2013-01-22  Jer Noble  <jer.no...@apple.com>
+
+        REGRESSION(r140344): Repeated crashes in WKTR PlatformWebView::viewSupportsOptions().
+        https://bugs.webkit.org/show_bug.cgi?id=107562
+
+        Rubber-stamped by Alexy Proskuryakov.
+
+        The input to WKBooleanGetValue() is not NULL-safe, so NULL check its inputs before calling.
+
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+
 2013-01-22  Alexey Proskuryakov  <a...@apple.com>
 
         One is not allowed to use commit-queue to make oneself a committer.

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (140441 => 140442)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2013-01-22 19:12:15 UTC (rev 140441)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2013-01-22 19:13:58 UTC (rev 140442)
@@ -109,7 +109,8 @@
     : m_windowIsKey(true)
 {
     WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing"));
-    bool useTiledDrawing = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()))) : false;
+    WKTypeRef useTiledDrawingValue = options ? WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()) : NULL;
+    bool useTiledDrawing = useTiledDrawingValue && WKBooleanGetValue(static_cast<WKBooleanRef>(useTiledDrawingValue));
 
     NSRect rect = NSMakeRect(0, 0, 800, 600);
     m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef useTiledDrawing:useTiledDrawing];
@@ -202,7 +203,8 @@
 bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
 {
     WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing"));
-    bool useTiledDrawing = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get())));
+    WKTypeRef useTiledDrawingValue = WKDictionaryGetItemForKey(options, useTiledDrawingKey.get());
+    bool useTiledDrawing = useTiledDrawingValue && WKBooleanGetValue(static_cast<WKBooleanRef>(useTiledDrawingValue));
 
     return useTiledDrawing == [(TestRunnerWKView *)m_view useTiledDrawing];
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to