Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ad897e6059c5b8005b11278b9768150a6775ad24
Ticket: 1882373fffffffffffffffffffffffffffffffff
Bug in code of Tcl_GetAlias in tclInterp.c
User & Date: an00na on 2008-01-30 04:32:04
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The last `for' loop in Tcl_GetAlias function:
      for (i = 1; i < objc; i++) {
        *argvPtr[i - 1] = TclGetString(objv[i]);
      }
    
    The bug spot is `*argvPtr[i - 1]'. Obviously, it should be `(*argvPtr)[i - 1]', otherwise, it causes invalid memory access when objc > 2, since it is only when idx is 0 that *argvPtr[idx] is the same as (*argvPtr)[idx] in effect.
    
    Thus, the fixed code is:
      for (i = 1; i < objc; i++) {
        (*argvPtr)[i - 1] = TclGetString(objv[i]);
      }
    
    It is verified by our application product.
    
    
  4. foundin changed to: "obsolete: 8.5.0"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "an00na"
  10. subsystem changed to: "20. [interp]"
  11. title changed to: "Bug in code of Tcl_GetAlias in tclInterp.c"
  12. type changed to: "Bug"