Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fbe3dcbbec61fcf6779bab343ca4584da0c4eefc
Ticket: 1283976fffffffffffffffffffffffffffffffff
Tcl_UniCharToUtf mishandles negative input
User & Date: dgp on 2005-09-07 13:55:34
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    dkf% scan [format %c -1] %c%c%c
    255 191 {}
    ...
    [09:43]dkf% string bytelength [format %c -1]
    2
    ...
    [09:43]dkfSo, [format %c -1] is *wrong*
    ...
    [09:44]dgphmmm... Tcl_UniCharToUtf accepts an "int"
    argument instead of a "Tcl_UniChar" one. 
    [09:44]dkfI think that's because some compilers
    aren't keen on arguments narrower than a word 
    [09:45]dgpbut the logic of the routine assumes an
    unsigned input.
    rmaxdgp: IIRC I also wondered about this when I worked
    on the -nocase stuff some time ago, and Jeff knew the
    reason why it is so.
    [09:45]dkfI think T_UCTU should cast it's argument to
    Tcl_UniChar
    [09:46]dkf(at the very least)
    ...
    [09:49]dgpok, so the flaw is in T_UCTU and not
    [format] itself ten
    [09:53]dkf[format] shouldn't be able to step outside
    the internal encoding model
    
    
  4. foundin changed to: "obsolete: 8.4.11"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "44. UTF-8 Strings"
  10. title changed to: "Tcl_UniCharToUtf mishandles negative input"
  11. type changed to: "Bug"