Skip to content
Tcl Source Code History Of Ticket 2738427fffffffff
Login

History Of Ticket 2738427fffffffff

Artifacts Associated With Ticket 2738427fffffffff

  1. Ticket change [390f21f693] (rid 112321) by dgp on 2009-04-06 19:41:37:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "44. UTF-8 Strings"
    11. title initialized to: "Tcl_NumUtfChars(..., -1) no overflow check"
    12. type initialized to: "Bug"
  2. Ticket change [ce3a494437] (rid 96017) by dgp on 2009-04-11 03:09:53:

    1. icomment:
      comment test....
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [c494b2dd0c] (rid 136998) by jan.nijtmans on 2014-02-21 19:07:44:

    1. assignee changed to: "jan.nijtmans"
  4. Ticket change [9aec2b5f75] (rid 154379) by jan.nijtmans on 2017-06-08 12:26:18:

    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"
  5. Ticket change [e889948306] (rid 154387) by jan.nijtmans on 2017-06-08 12:41:17:

    1. closedate changed to: "2457913.02867168"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Fixed in core-8-5-branch, core-8-6-branch and trunk.
      
      For Tcl 9 it would be better to change the signature of Tcl_NumUtfChars (using size_t length parameter and return value in stead of int), but that's out-of-scope for this ticket.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  6. Ticket change [4308e5f95b] (rid 154389) by dgp on 2017-06-08 12:54:47:

    1. closedate changed to: "2457913.03804544"
    2. closer changed to: "dgp"
    3. icomment:
      
      Thanks for finding and addressing this old ticket.
      
      I'm worried it's not quite a correct answer.
      
      The overflow detection is only done after
      the loop ends, and not at each pass through
      the loop.  This leaves open the possibility
      that i could circle all the way back to a
      non-negative value before '\0' is seen and
      we get a count that's (UINT_MAX + 1) too small.
      
      Since the return type can only handle a value
      up to INT_MAX, and since there's no error
      reporting channel available, should this routine
      just panic for inputs outside that supportable range?
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  7. Ticket change [743cd7c154] (rid 154394) by jan.nijtmans on 2017-06-08 13:45:29:

    1. closedate changed to: "2457913.07326046"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Yes I'm aware that this is not 100% correct yet, in Tcl 9 we can do better. Panicing would be OK to me, it's not a use-case that will be encountered in real life .....
      
      Thank you, Don, for your feedback!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
  8. Ticket change [57658785df] (rid 154395) by dgp on 2017-06-08 14:22:55:

    1. assignee changed to: "dgp"
    2. closer changed to: "nobody"
    3. icomment:
      
      Adding another way for a Tcl-using program
      to crash doesn't strike me as a great answer
      either. I need more thought on it.
      
      Re-opening and assigning to myself as a
      reminder to look again sometime.
      
      Not changing anything checked in though.
      It's at least as good as what was there before.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. status changed to: "Open"
  9. Ticket change [d07e088e19] (rid 154396) by jan.nijtmans on 2017-06-08 14:54:25:

    1. icomment:
      Sure, Don, please go ahead! I'm out of ideas for 8.x ....
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  10. Ticket change [ba5bbee20a] (rid 181854) by dgp on 2020-04-16 19:53:06:

    1. closedate changed to: "2458956.32854185"
    2. closer changed to: "dgp"
    3. icomment:
      
      Fix completed in 8.5 now.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"