Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0d46d633ee941a31a98ad39780db61a517c70a5a
Ticket: 821499ffffffffffffffffffffffffffffffffff
Tcl_AppendToObj disobeys length
User & Date: dgp on 2003-10-10 21:38:50
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    #include "tcl.h"
    
    int
    main(int argc, char **argv)
    {
        Tcl_UniChar ch = 0;
        Tcl_Obj *objPtr = Tcl_NewUnicodeObj(&ch,0);
    
        Tcl_AppendToObj(objPtr,"\302\242",1);
        ch = Tcl_GetUniChar(objPtr, 0);
        if (ch != 0xC2) {
            printf("BUG!\n");
            if (ch == 0xA2) {
                printf("Tcl_AppendToObj scanned > 1 byte\n");
            }
        }
    }
    
    
    Compile and run this test program for evidence
    that Tcl_AppendToObj does not honor its
    length argument.  It will scan more than "length"
    bytes if it thinks it's in the middle of a UTF-8 sequence.
    
  4. foundin changed to: "obsolete: 8.5a0"
  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: "10. Objects"
  10. title changed to: "Tcl_AppendToObj disobeys length "
  11. type changed to: "Bug"