Title: [98186] trunk/Source/WebKit2
Revision
98186
Author
wei...@apple.com
Date
2011-10-21 20:25:07 -0700 (Fri, 21 Oct 2011)

Log Message

Fix crash below CoreIPC::MessageSender<WebKit::WebPage>::send<Messages::WebPageProxy::DidPerformDictionaryLookup>
https://bugs.webkit.org/show_bug.cgi?id=70667
<rdar://problem/9622186>

Reviewed by Anders Carlsson.

* Shared/DictionaryPopupInfo.cpp:
(WebKit::DictionaryPopupInfo::encode):
(WebKit::DictionaryPopupInfo::decode):
Account for the fact that the options dictionary can be null. This is due to Lookup passing
back a null, rather than empty, dictionary when it could not find any interesting characteristics.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (98185 => 98186)


--- trunk/Source/WebKit2/ChangeLog	2011-10-22 03:15:41 UTC (rev 98185)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-22 03:25:07 UTC (rev 98186)
@@ -1,5 +1,19 @@
 2011-10-21  Sam Weinig  <s...@webkit.org>
 
+        Fix crash below CoreIPC::MessageSender<WebKit::WebPage>::send<Messages::WebPageProxy::DidPerformDictionaryLookup>
+        https://bugs.webkit.org/show_bug.cgi?id=70667
+        <rdar://problem/9622186>
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/DictionaryPopupInfo.cpp:
+        (WebKit::DictionaryPopupInfo::encode):
+        (WebKit::DictionaryPopupInfo::decode):
+        Account for the fact that the options dictionary can be null. This is due to Lookup passing
+        back a null, rather than empty, dictionary when it could not find any interesting characteristics.
+
+2011-10-21  Sam Weinig  <s...@webkit.org>
+
         Add WKBrowsingContextGroup which wraps WKPageGroupRef
         https://bugs.webkit.org/show_bug.cgi?id=70665
 

Modified: trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp (98185 => 98186)


--- trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp	2011-10-22 03:15:41 UTC (rev 98185)
+++ trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp	2011-10-22 03:25:07 UTC (rev 98186)
@@ -41,7 +41,10 @@
     encoder->encodeEnum(type);
 
 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
-    CoreIPC::encode(encoder, options.get());
+    bool hadOptions = options;
+    encoder->encodeBool(hadOptions);
+    if (hadOptions)
+        CoreIPC::encode(encoder, options.get());
 #endif
 }
 
@@ -54,8 +57,13 @@
     if (!decoder->decodeEnum(result.type))
         return false;
 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
-    if (!CoreIPC::decode(decoder, result.options))
+    bool hadOptions;
+    if (!decoder->decodeBool(hadOptions))
         return false;
+    if (hadOptions) {
+        if (!CoreIPC::decode(decoder, result.options))
+            return false;
+    }
 #endif
     return true;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to