Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a8659bd4b267257d989aa1bcf4e0477e8fd66513
Ticket: 3484402fffffffffffffffffffffffffffffffff
off-by-one address error in AppendUnicodeToUnicodeRep
User & Date: dgp on 2012-02-08 21:56:11
Changes

  1. icomment:
    
    Thanks for the review.
    
    Regarding memmove, consider this:
    
        objPtr = Tcl_NewStringObj("foo bar dingbat", -1);
        p = Tcl_GetString(objPtr);
        Tcl_SetObjLength(objPtr, 3);
        Tcl_AppendToObj(objPtr, p+7, 8);
    
    which should produce the value 'foo dingbat'.
    
    That involves a copy of overlapping byte sequences.
    
    Similar sequence with the unicode rep is also possible.
    
    It's easy to forget that stringPtr->allocated can be strictly
    larger than objPtr->length + 1 and stringPtr->uallocated
    can be strictly larger than (stringPtr->numChars + 1)*sizeof(Tcl_UniChar)
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"