2010-04-16 Fumitoshi Ukai <ukai@chromium.org>
authorukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Apr 2010 23:13:30 +0000 (23:13 +0000)
committerukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Apr 2010 23:13:30 +0000 (23:13 +0000)
commit5e0c9546295257e0af6d7d0610e40508c56a2618
tree58b12bf0925f526b45746dde01a77d817a368c64
parent7fe61f945d3bcb56d5ecfb67d4801e3e42d43963
2010-04-16  Fumitoshi Ukai  <ukai@chromium.org>

        Reviewed by Alexey Proskuryakov.

        WebSocket crash when it receives bad header.
        https://bugs.webkit.org/show_bug.cgi?id=37682

        * websocket/tests/bad-handshake-crash-expected.txt: Added.
        * websocket/tests/bad-handshake-crash.html: Added.
        * websocket/tests/bad-handshake-crash_wsh.py: Added.
        * websocket/tests/script-tests/bad-handshake-crash.js: Added.
2010-04-16  Fumitoshi Ukai  <ukai@chromium.org>

        Reviewed by Alexey Proskuryakov.

        WebSocket crash when it receives bad header.
        https://bugs.webkit.org/show_bug.cgi?id=37682

        If name or value is not valid UTF-8, nameStr or valueStr would be
        null string, so crashed in headers->add(nameStr, valueStr).
        Check both nameStr and valueStr are not null string.
        Otherwise handshake will fail.

        Test: websocket/tests/bad-handshake-crash.html

        * websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::readHTTPHeaders): check nameStr and valueStr are not null string.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/websocket/tests/bad-handshake-crash-expected.txt [new file with mode: 0644]
LayoutTests/websocket/tests/bad-handshake-crash.html [new file with mode: 0644]
LayoutTests/websocket/tests/bad-handshake-crash_wsh.py [new file with mode: 0644]
LayoutTests/websocket/tests/script-tests/bad-handshake-crash.js [new file with mode: 0644]
WebCore/ChangeLog
WebCore/websockets/WebSocketHandshake.cpp