Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9aec2b5f75b62d2a9eb0f456259e246b19306e9f
Ticket: 2738427fffffffffffffffffffffffffffffffff
Tcl_NumUtfChars(...) no overflow check
User & Date: jan.nijtmans on 2017-06-08 12:26:18
Changes

  1. closer changed to: "nobody"
  2. comment changed to:
    Tcl_NumUtfChars(unicode, -1) can return negative
    counts if there are really more than INT_MAX Utf
    chars located at unicode before a terminating \0
    is seen.
    
    In addition, there is another overflow problem, e.g.
    Tcl_NumUtfChars("\xE2\x82\xAC", 2): This call returns
    1 instead of the expected 2.
    
  3. icomment:
    Problem with the Tcl_NumUtfChars("\xE2\x82\xAC", 2) call is that
    the 3th byte is read, even though a length of only 2 bytes was
    requested. Since with only 2 bytes, the unicode character is
    incomplete, Tcl_NumUtfChars() should count this as 2 separate bytes.
    
  4. login: "jan.nijtmans"
  5. mimetype: "text/plain"
  6. severity changed to: "Minor"
  7. title changed to: "Tcl_NumUtfChars(...) no overflow check"