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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24904</bug_id>
          
          <creation_ts>2014-03-03 23:45:09 +0000</creation_ts>
          <short_desc>Uint8Array parameters should not be modifiable after method calls return</short_desc>
          <delta_ts>2014-05-02 20:15:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Encrypted Media Extensions</component>
          <version>unspecified</version>
          <rep_platform>All</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>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Dorwin">ddorwin</reporter>
          <assigned_to name="David Dorwin">ddorwin</assigned_to>
          <cc>acolwell</cc>
    
    <cc>hsivonen</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
    
    <cc>silviapfeiffer1</cc>
    
    <cc>watsonm</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101798</commentid>
    <comment_count>0</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-03-03 23:45:09 +0000</bug_when>
    <thetext>MediaKeys.createSession() and MediaKeySession.update() both accept Uint8Arrays. Since these methods schedule a task, it&apos;s possible that JavaScript can modify the contents of those arrays before the task is run.

For example:
  array[0]=0;
  mediaKeys.createSession(&quot;video/webm&quot;, array);
  array[0]=9;
  // Scheduled task will run later and see 9 in the first element.

Similar issues have been reported in MSE, WebCrypto, and DataCue in the HTML spec (bug 24687).

This was originally raised in http://lists.w3.org/Archives/Public/public-html-media/2014Feb/0019.html. The consensus in that thread seems to be:
1) We should have a consistent approach across specs.
2) The behavior should instead be effectively a copy (implemented using a copy-on-write optimization if desired).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102525</commentid>
    <comment_count>1</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-03-17 23:51:13 +0000</bug_when>
    <thetext>Bug 24687 has been resolved by specifying that a copy should be made.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104989</commentid>
    <comment_count>2</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-05-02 20:15:00 +0000</bug_when>
    <thetext>Added copy steps for all Uint8Array parameters in https://dvcs.w3.org/hg/html-media/rev/af33cfce6d49.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>