Skip to content
Tcl Source Code View Ticket
Login

View Ticket

possible segv in tclIO.c?

Closed / Fixed1564642fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-09-24 18:18:13
In tclIO.c at line 1277 we find the following code:

    while (statePtr->topChanPtr != prevChanPtr) {
statePtr = statePtr->nextCSPtr;
    }

    if (statePtr == NULL) {
        ....
    }

Now: statePtr cannot be NULL at the end of the loop (or
else the loop condition would segfault): this is either
a bug or dead code.

PS: this is coverity bug #51 for Tcl.
andreas_kupriesplain2006-09-26 04:56:11
Logged In: YES 
user_id=75003

Fixed in both 8.4 branch, and head. Added a check for NULL
to the loop guard.
Log in (anonymous is fine) to add a comment.