Changeset 148043 in webkit


Ignore:
Timestamp:
Apr 9, 2013 1:35:22 PM (11 years ago)
Author:
andersca@apple.com
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):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r148038 r148043  
     12013-04-09  Anders Carlsson  <andersca@apple.com>
     2
     3        If we fail to decode a message name, pass the message length as the name
     4        https://bugs.webkit.org/show_bug.cgi?id=114305
     5        <rdar://problem/13605703>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * Platform/CoreIPC/ArgumentDecoder.h:
     10        (CoreIPC::ArgumentDecoder::length):
     11        * Platform/CoreIPC/Connection.cpp:
     12        (CoreIPC::Connection::processIncomingMessage):
     13
    1142013-04-08  Dean Jackson  <dino@apple.com>
    215
  • trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h

    r141619 r148043  
    4343
    4444    uint64_t destinationID() const { return m_destinationID; }
     45    size_t length() const { return m_bufferEnd - m_buffer; }
    4546
    4647    bool isInvalid() const { return m_bufferPos > m_bufferEnd; }
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r147508 r148043  
    3131#include <wtf/CurrentTime.h>
    3232#include <wtf/HashSet.h>
     33#include <wtf/text/WTFString.h>
    3334
    3435using namespace WebCore;
     
    620621
    621622    if (!m_workQueueMessageReceivers.isValidKey(message->messageReceiverName())) {
     623        if (message->messageReceiverName().isEmpty() && message->messageName().isEmpty()) {
     624            // Something went wrong when decoding the message. Encode the message length so we can figure out if this
     625            // happens for certain message lengths.
     626            CString messageReceiverName = "<unknown message>";
     627            CString messageName = String::format("<message length: %zu bytes>", incomingMessage->length()).utf8();
     628
     629            m_clientRunLoop->dispatch(bind(&Connection::dispatchDidReceiveInvalidMessage, this, messageReceiverName, messageName));
     630            return;
     631        }
     632
    622633        m_clientRunLoop->dispatch(bind(&Connection::dispatchDidReceiveInvalidMessage, this, message->messageReceiverName().toString(), message->messageName().toString()));
    623634        return;
Note: See TracChangeset for help on using the changeset viewer.