• Derek Cheng's avatar
    [Cast channel Fix MessageFramer body size check. · 3c91f864
    Derek Cheng authored
    The cast protocol allows a max message size of 64kb = 65536 bytes.
    However Chrome does not enforce this correctly in the following ways:
    - 65535 is used instead of 65536 as the max limit
    - The limit should not include the 4 byte header, but Chrome includes it
    (e.g., the IOBuffer used to read both only has 65535 bytes of capacity)
    
    This patch fixes this by allocating 65536 + 4 bytes for the input
    buffer, and modifying the check for message size against 65536.
    
    Bug: 822611
    Change-Id: I27121abb57dee5aee9741173e19cf0178184477d
    Reviewed-on: https://chromium-review.googlesource.com/996475
    Commit-Queue: Derek Cheng <imcheng@chromium.org>
    Reviewed-by: default avatarAdam Parker <amp@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#548860}
    3c91f864
cast_framer_unittest.cc 5.67 KB