Commit 522261ae authored by andersca@apple.com's avatar andersca@apple.com

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cd3f5106
2013-04-09 Anders Carlsson <andersca@apple.com>
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 <dino@apple.com>
Don't create another plugin process for restarted plugins
......@@ -42,6 +42,7 @@ public:
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; }
......
......@@ -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 @@ void Connection::processIncomingMessage(PassOwnPtr<MessageDecoder> incomingMessa
}
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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment