Bug 35715 - WebSocket test to transfer null character
Summary: WebSocket test to transfer null character
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Fumitoshi Ukai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 19:22 PST by Fumitoshi Ukai
Modified: 2010-03-05 01:54 PST (History)
1 user (show)

See Also:


Attachments
Patch (2.96 KB, patch)
2010-03-03 23:58 PST, Fumitoshi Ukai
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fumitoshi Ukai 2010-03-03 19:22:23 PST
We should have test that WebSocket could send/receive message contains null character, which is frame type.
Comment 1 Fumitoshi Ukai 2010-03-03 23:58:10 PST
Created attachment 49993 [details]
Patch
Comment 2 Alexey Proskuryakov 2010-03-04 10:28:43 PST
Comment on attachment 49993 [details]
Patch

r=me, thank you for making the test!

It makes me somewhat nervous that we have the following FIXME in send():

    // FIXME: check message is valid utf8.

Can one sneak 0xff in by passing invalid UTF-16 to send()? String::utf8() relies on platform-provided encoder, and I don't even know what ICU does for invalid input, let alone other implementations.
Comment 3 Fumitoshi Ukai 2010-03-05 01:51:52 PST
Committed r55574: <http://trac.webkit.org/changeset/55574>
Comment 4 Fumitoshi Ukai 2010-03-05 01:54:05 PST
(In reply to comment #2)
> (From update of attachment 49993 [details])
> r=me, thank you for making the test!
> 
> It makes me somewhat nervous that we have the following FIXME in send():
> 
>     // FIXME: check message is valid utf8.
> 
> Can one sneak 0xff in by passing invalid UTF-16 to send()? String::utf8()
> relies on platform-provided encoder, and I don't even know what ICU does for
> invalid input, let alone other implementations.

Hmm, I think any values represented in UTF-16 couldn't be 0xff in UTF-8, since UTF-8 bit pattern should have at least one zero bit in every bytes.
Maybe, we could remove this comment..