Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 67e146dfbef71a0024a65abccd7a5d81accea8dc4c06b4590c5806276f138be5
Ticket: 8c4082563d6a7ebda4b8804e221a0de31c4c40e4
Tcl_Eval() result can be truncated at NUL
User & Date: serhiy.storchaka on 2024-06-23 14:04:21
Changes

  1. closedate changed to: "2460485.08636199"
  2. closer changed to: "serhiy.storchaka"
  3. icomment:
    I tested also other eval functions (they are not used in Tkinter). `Tcl_EvalObjEx`, `Tcl_EvalEx` and `Tcl_GlobalEvalObj` do not truncate the result. `Tcl_VarEval` and `Tcl_GlobalEval` truncate the result.
    
    Looking at the code of `Tcl_Eval`, it is simply `Tcl_EvalEx` followed by `Tcl_GetStringResult`. So the result is truncated in `Tcl_GetStringResult`.
    
    The documentation for `Tcl_NewStringObj` implies that embedded null bytes are acceptable if the length is specified.
    
  4. login: "serhiy.storchaka"
  5. mimetype: "text/x-markdown"