Title: [148043] trunk/Source/WebKit2
Revision
148043
Author
[email protected]
Date
2013-04-09 13:35:22 -0700 (Tue, 09 Apr 2013)

Log Message

If we fail to decode a message name, pass the message length as the name
https://bugs.webkit.org/show_bug.cgi?id=114305
<rdar://problem/13605703>

Reviewed by Sam Weinig.

* Platform/CoreIPC/ArgumentDecoder.h:
(CoreIPC::ArgumentDecoder::length):
* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::processIncomingMessage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (148042 => 148043)


--- trunk/Source/WebKit2/ChangeLog	2013-04-09 20:18:46 UTC (rev 148042)
+++ trunk/Source/WebKit2/ChangeLog	2013-04-09 20:35:22 UTC (rev 148043)
@@ -1,3 +1,16 @@
+2013-04-09  Anders Carlsson  <[email protected]>
+
+        If we fail to decode a message name, pass the message length as the name
+        https://bugs.webkit.org/show_bug.cgi?id=114305
+        <rdar://problem/13605703>
+
+        Reviewed by Sam Weinig.
+
+        * Platform/CoreIPC/ArgumentDecoder.h:
+        (CoreIPC::ArgumentDecoder::length):
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::processIncomingMessage):
+
 2013-04-08  Dean Jackson  <[email protected]>
 
         Don't create another plugin process for restarted plugins

Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h (148042 => 148043)


--- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h	2013-04-09 20:18:46 UTC (rev 148042)
+++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h	2013-04-09 20:35:22 UTC (rev 148043)
@@ -42,6 +42,7 @@
     virtual ~ArgumentDecoder();
 
     uint64_t destinationID() const { return m_destinationID; }
+    size_t length() const { return m_bufferEnd - m_buffer; }
 
     bool isInvalid() const { return m_bufferPos > m_bufferEnd; }
     void markInvalid() { m_bufferPos = m_bufferEnd + 1; }

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (148042 => 148043)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-04-09 20:18:46 UTC (rev 148042)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-04-09 20:35:22 UTC (rev 148043)
@@ -30,6 +30,7 @@
 #include <WebCore/RunLoop.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
+#include <wtf/text/WTFString.h>
 
 using namespace WebCore;
 
@@ -619,6 +620,16 @@
     }
 
     if (!m_workQueueMessageReceivers.isValidKey(message->messageReceiverName())) {
+        if (message->messageReceiverName().isEmpty() && message->messageName().isEmpty()) {
+            // Something went wrong when decoding the message. Encode the message length so we can figure out if this
+            // happens for certain message lengths.
+            CString messageReceiverName = "<unknown message>";
+            CString messageName = String::format("<message length: %zu bytes>", incomingMessage->length()).utf8();
+
+            m_clientRunLoop->dispatch(bind(&Connection::dispatchDidReceiveInvalidMessage, this, messageReceiverName, messageName));
+            return;
+        }
+
         m_clientRunLoop->dispatch(bind(&Connection::dispatchDidReceiveInvalidMessage, this, message->messageReceiverName().toString(), message->messageName().toString()));
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to