<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>30656</bug_id>
          
          <creation_ts>2009-10-21 18:42:45 -0700</creation_ts>
          <short_desc>Fix calculation of length in WebSocketChannel.cpp</short_desc>
          <delta_ts>2009-10-22 01:32:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Fumitoshi Ukai">ukai</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>156747</commentid>
    <comment_count>0</comment_count>
    <who name="Fumitoshi Ukai">ukai</who>
    <bug_when>2009-10-21 18:42:45 -0700</bug_when>
    <thetext>length = length * 128 + *p &amp; 0x7f;
is wrong, because &amp; is less precedence than +.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156748</commentid>
    <comment_count>1</comment_count>
      <attachid>41627</attachid>
    <who name="Fumitoshi Ukai">ukai</who>
    <bug_when>2009-10-21 18:45:59 -0700</bug_when>
    <thetext>Created attachment 41627
Fix calculation of length in WebSocketChannel.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156807</commentid>
    <comment_count>2</comment_count>
      <attachid>41627</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-10-21 23:57:04 -0700</bug_when>
    <thetext>Comment on attachment 41627
Fix calculation of length in WebSocketChannel.cpp

r=me

Will this covered by layout tests once we have them?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156814</commentid>
    <comment_count>3</comment_count>
    <who name="Fumitoshi Ukai">ukai</who>
    <bug_when>2009-10-22 00:05:46 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 41627 [details])
&gt; r=me
&gt; 
&gt; Will this covered by layout tests once we have them?

Well, how about the following data sequence?
 0x81 0x81 0xCC 0x00 &quot;unexpected data&quot; 0xFF

It must skip 129 bytes after second 0x81, but wrong code gets 1 as length, so it would receive &quot;unexpected data&quot; unexpectedly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156816</commentid>
    <comment_count>4</comment_count>
      <attachid>41627</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-22 00:11:31 -0700</bug_when>
    <thetext>Comment on attachment 41627
Fix calculation of length in WebSocketChannel.cpp

Clearing flags on attachment: 41627

Committed r49932: &lt;http://trac.webkit.org/changeset/49932&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156818</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-22 00:11:35 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156834</commentid>
    <comment_count>6</comment_count>
    <who name="Fumitoshi Ukai">ukai</who>
    <bug_when>2009-10-22 01:32:12 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (From update of attachment 41627 [details] [details])
&gt; &gt; r=me
&gt; &gt; 
&gt; &gt; Will this covered by layout tests once we have them?
&gt; 
&gt; Well, how about the following data sequence?
&gt;  0x81 0x81 0xCC 0x00 &quot;unexpected data&quot; 0xFF

Oops. should be 0x80 0x81 0x81 0xCC 0x00 &quot;unexpected data&quot; 0xFF

&gt; 
&gt; It must skip 129 bytes after second 0x81, but wrong code gets 1 as length, so
&gt; it would receive &quot;unexpected data&quot; unexpectedly.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>41627</attachid>
            <date>2009-10-21 18:45:59 -0700</date>
            <delta_ts>2009-10-22 00:11:31 -0700</delta_ts>
            <desc>Fix calculation of length in WebSocketChannel.cpp</desc>
            <filename>bug-30656-20091022104557.patch</filename>
            <type>text/plain</type>
            <size>1126</size>
            <attacher name="Fumitoshi Ukai">ukai</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ZGY2M2NmNS4uNzczZjliOCAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMyBAQAorMjAwOS0xMC0yMSAgRnVtaXRvc2hpIFVr
YWkgIDx1a2FpQGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICBGaXggY2FsY3VsYXRpb24gb2YgbGVuZ3RoIGluIFdlYlNvY2tldENo
YW5uZWwuY3BwCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9p
ZD0zMDY1NgorCisgICAgICAgICogd2Vic29ja2V0cy9XZWJTb2NrZXRDaGFubmVsLmNwcDoKKyAg
ICAgICAgKFdlYkNvcmU6OldlYlNvY2tldENoYW5uZWw6OmRpZFJlY2VpdmVEYXRhKToKKwogMjAw
OS0xMC0yMSAgRHVtaXRydSBEYW5pbGl1YyAgPGR1bWlAY2hyb21pdW0ub3JnPgogCiAgICAgICAg
IFJldmlld2VkIGJ5IERpbWl0cmkgR2xhemtvdi4KZGlmZiAtLWdpdCBhL1dlYkNvcmUvd2Vic29j
a2V0cy9XZWJTb2NrZXRDaGFubmVsLmNwcCBiL1dlYkNvcmUvd2Vic29ja2V0cy9XZWJTb2NrZXRD
aGFubmVsLmNwcAppbmRleCAxNDVjZDM0Li41Y2JiZDI0IDEwMDY0NAotLS0gYS9XZWJDb3JlL3dl
YnNvY2tldHMvV2ViU29ja2V0Q2hhbm5lbC5jcHAKKysrIGIvV2ViQ29yZS93ZWJzb2NrZXRzL1dl
YlNvY2tldENoYW5uZWwuY3BwCkBAIC0xODQsNyArMTg0LDcgQEAgdm9pZCBXZWJTb2NrZXRDaGFu
bmVsOjpkaWRSZWNlaXZlRGF0YShTb2NrZXRTdHJlYW1IYW5kbGUqIGhhbmRsZSwgY29uc3QgY2hh
ciogZGEKICAgICAgICAgICAgICAgICAgICAgaGFuZGxlLT5jbG9zZSgpOwogICAgICAgICAgICAg
ICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGxlbmd0
aCA9IGxlbmd0aCAqIDEyOCArICpwICYgMHg3ZjsKKyAgICAgICAgICAgICAgICBsZW5ndGggPSBs
ZW5ndGggKiAxMjggKyAoKnAgJiAweDdmKTsKICAgICAgICAgICAgICAgICArK3A7CiAgICAgICAg
ICAgICB9CiAgICAgICAgICAgICBpZiAocCArIGxlbmd0aCA8IGVuZCkgew==
</data>

          </attachment>
      

    </bug>

</bugzilla>