Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-01-30
17:47 • Closed ticket [1882373fff]: Bug in code of Tcl_GetAlias in tclInterp.c plus ... artifact: d38801ed98 user: msofer
17:23 • Ticket [1882373fff]: 1 change artifact: 2dd8904563 user: dkf
04:32 • New ticket [1882373fff]. artifact: ad897e6059 user: an00na

Bug in code of Tcl_GetAlias in tclInterp.c

Closed / Fixed1882373fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-01-30 04:32:04
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.
dkf Ticket [1882373fff]: 1 change [History diff]2008-01-30 17:23:02
msoferplain2008-01-30 17:47:28
Logged In: YES 
user_id=148712
Originator: NO

Fixed in HEAD and 8.4
Log in (anonymous is fine) to add a comment.