Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d70c6ce1aa32a7944bb8f1756b1a78808a260558
Ticket: 1366195fffffffffffffffffffffffffffffffff
Use TCL_DSTRING_STATIC_SIZE rather than assume size
User & Date: afredd on 2006-04-04 15:50:41
Changes

  1. icomment:
    Logged In: YES 
    user_id=1386588
    
    >The change that would help them a bit would be
    >to patch Tcl's source code so that it did not
    >assume a value of TCL_DSTRING_STATIC_SIZE, but
    >just used whatever value the header provided.
    >
    
    ie. replace TDSS with literal "200"'s in the core?
    
    >The patch submitted did the opposite, setting a
    >limit on what value of TCL_DSTRING_STATIC_SIZE
    >can get set.
    
    You mean an extension comiled with TDSS==4 using
    Tcl_GetEncodingNameFromEnvironment linked to a core
    with a regular TDSS==200 wouldn't have it DString
    lengthened, and would still crash.
    Good point - i hadn't thought of that.
    The fix would be to remove the #if-ery, and just always:
    
    Tcl_DStringSetLength(bufPtr,(2*(3+TCL_INTEGER_SPACE)));
    
    My patch was only intended to allow TDSS to be set low and
    not cause a stack corruption. Allowing for varying
    values of TDSS between extensions and the core is a whole
    different ball game. My opinion is that it is merely
    a documentation issue - caveat programmor.
    
    
    
    
  2. login: "afredd"
  3. mimetype: "text/plain"
  4. username: "afredd"