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.