Skip to content
Tcl Source Code History Of Ticket 885c86a9a0
Login

History Of Ticket 885c86a9a0

Artifacts Associated With Ticket 885c86a9a0

  1. Ticket change [8e367b361d] (rid 208783) by apnadkarni on 2023-02-15 11:04:39:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      Consider 
      
      ```
      % package require Tcl
      8.7a6
      % codepoints [encoding convertfrom utf-8 \xf0\x80\x80\x80]
      U+0000F0 U+0020AC U+000080 U+000080
      ```
      
      This should map to U+10000 or at least the equivalent surrogate pair.
      
    5. foundin initialized to: "8.7"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to: "convertfrom utf8 breaks for 4 byte utf encodings"
    16. type initialized to: "Bug"
  2. Ticket change [94a08270f2] (rid 208784) by jan.nijtmans on 2023-02-15 11:35:12:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Here, \xf0\x80\x80\x80 is an illegal overlong sequence, so it's split into its bytes. Compare this with Tcl 8.6:
      <pre>
      % package require Tcl
      8.6.13
      % codepoints [encoding convertfrom utf-8 \xf0\x80\x80\x80]
      U+0000F0 U+000080 U+000080 U+000080
      </pre>
      
      But now TIP #389 should take it's role, which describes the fallback to cp1252. Therefore, the actual answer should be: U+0000F0 U+0020AC U+0020AC U+0020AC (since byte 0x80 is the euro-sign in cp1252)
      
      Not high prio to fix, since it's an illegal byte sequence anyway. When using -strict it throws an exception:
      <pre>
      $ tclsh8.7
      % encoding convertfrom -strict utf-8 \xf0\x80\x80\x80
      unexpected byte sequence starting at index 0: '\xF0'
      </pre>
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [bcdc9a1c57] (rid 208785) by apnadkarni on 2023-02-15 16:19:37:

    1. icomment:
      I shouldn't do UTF arithmetic in my head, I worked it out to U+10000.
      
      Yes, I know it is an overlong sequence but invalid sequences is what I am testing. 
      
      There is no rush with this, I'm just generating test cases to cover as many combinations of invalid sequences that I can from the Unicode standard tables.
      Tedious but half the security related bugs in encoders/decoders seem to come from invalid sequences so I don't consider them unimportant.
      
      /Ashok
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  4. Ticket change [15103e545c] (rid 208786) by jan.nijtmans on 2023-02-15 16:51:05:

    1. icomment:
      > Tedious but half the security related bugs in encoders/decoders seem to come from invalid sequences so I don't consider them unimportant.
      
      Yes, they are important, but the Utf encoders/decoders were already fixed for this possible security issue since 8.6.8 or so. Nothing new for 8.7/9.0
      
      See: [67aa9a2070]
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [8e8e038349] (rid 208787) by apnadkarni on 2023-02-15 17:15:44:

    1. icomment:
      Is this cp1252 mapping supposed to happen only when decoding utf-8 or for all encodings (ascii, shiftjis) ? I don't actually see this specified anywhere. TIP 389 only talks about utf<->unichar mapping.
      
      And I assume the C level behaviour is supposed to map to the script level encoding commands?
      
      /Ashok
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  6. Ticket change [cdd22cb0eb] (rid 208788) by apnadkarni on 2023-02-15 17:20:29:

    1. icomment:
      > Yes, they are important, but the Utf encoders/decoders were already fixed for this possible security issue since 8.6.8 or so. Nothing new for 8.7/9.0 
      
      I wasn't talking purely about overlong sequences. In general, misbehavior or bugs with invalid sequence handling in whatever form should not be taken lightly. That is why the standard is so particular about conformant error handling.
      
      /Ashok
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  7. Ticket change [d58852d14b] (rid 208798) by jan.nijtmans on 2023-02-16 07:20:49:

    1. icomment:
      > Is this cp1252 mapping supposed to happen only when decoding utf-8 or for all encodings (ascii, shiftjis) ? I don't actually see this specified anywhere. TIP 389 only talks about utf<->unichar mapping.
      
      ... thinking back to long ago .....
      
      According to the TIP it's built into the utf -> unichar encoder, nowhere else. So it should only apply to utf-8 (and cesu-8), not to any other encoders.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [2e1dc0ff2d] (rid 208831) by jan.nijtmans on 2023-02-16 21:54:12:

    1. icomment: "Should be fixed [5627ae0620283c35|here]"
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  9. Ticket change [361d23e5c8] (rid 209000) by jan.nijtmans on 2023-02-22 08:04:55:

    1. closedate changed to: "2459997.83675914"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Fixed [c9645172df|here]
      
      Thanks, Ashok, for the report!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. status changed to: "Closed"