Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-05-22
22:18 • Closed ticket [1968245fff]: Tcl_LogCommandInfo() fails with length == -1 plu... artifact: 2a305b5446 user: dgp
22:14 • Ticket [1968245fff]: 4 changes artifact: b66a396e82 user: dgp
2008-05-21
20:42 • Ticket [1968245fff]: 2 changes artifact: ec99a352c0 user: dgp
03:39 • Ticket [1968245fff]: 4 changes artifact: 8cebc6c84b user: cdarroch
03:36 • Add attachment tclNamesp.c.patch to ticket [1968245fffffffff|1968245fff... artifact: a30c3f353a user: cdarroch
03:36 • Ticket [1968245fff] Tcl_LogCommandInfo() fails with length == -1 status stil... artifact: c13f00c515 user: cdarroch
2008-05-20
20:36 • New ticket [1968245fff]. artifact: 8aa9d207a5 user: cdarroch

Tcl_LogCommandInfo() fails with length == -1

Closed / Fixed1968245fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-05-20 20:36:38
With Tcl 8.5.2, Tcl_LogCommandInfo() uses its length
argument in the following test before checking whether
length is negative, which a caller may use to indicate
that all bytes of the command argument (up to the first
null byte) should be used.  At least, the documentation
and code comments imply this is how the function
should operate, and it used to accept -1 as a length
value in 8.4.

Attached is a simple patch which checks for this and
uses strlen() to determine the length of the command
string.
cdarrochplain2008-05-21 03:36:39
File Added - 278472: tclNamesp.c.patch
cdarrochplain2008-05-21 03:39:43
Logged In: YES 
user_id=637999
Originator: YES

Sorry, that wasn't particularly clear.  The test in question is:

overflow = (length > limit);

I believe length needs to be non-negative before this test
is performed.
dgp Ticket [1968245fff]: 2 changes [History diff]2008-05-21 20:42:08
dgpplain2008-05-22 22:14:10
Logged In: YES 
user_id=80530
Originator: NO


2005-09-14 commit to tclBasic.c
introduced this bug.
dgpplain2008-05-22 22:18:32
Logged In: YES 
user_id=80530
Originator: NO


Fixed on HEAD and for 8.5.3
Log in (anonymous is fine) to add a comment.

Attachments: