Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Array size bug in TeststringobjCmd in Tcl 8.1a2

Closed / Fixed218454ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:00:35
OriginalBugID: 583 Bug
Version: 8.1a2
SubmitDate: '1998-05-21'
LastModified: '1998-12-08'
Severity: SER
Status: Released
Submitter: hershey
ChangedBy: stanton
OS: All
OSVersion: NA
Machine: NA
FixedDate: '1998-12-08'
FixedInVersion: 8.1b1
ClosedDate: '2000-10-25'


The array strings in TeststringobjCmd in tclTestObj.c in Tcl 8.1a2 is

too small.  The call to Tcl_AppendStringsToObj refers to strings[11].

However, the strings array is defined to have only 11 entries, which

means that strings[11] is past the end of the array.



I've appended the obvious patch.



Ian



*** tclTestObj.c.~1~    Fri Apr 10 15:44:54 1998

--- tclTestObj.c        Fri Apr 10 15:45:32 1998

*************** TeststringobjCmd(clientData, interp, obj

*** 851,857 ****

      Tcl_Obj *CONST objv[];    /* Argument objects. */

  {

      int varIndex, option, i, length;

! #define MAX_STRINGS 10

      char *index, *string, *strings[MAX_STRINGS+1];

      static char *options[] = {

        "append", "appendstrings", "get", "get2", "length", "length2",

--- 851,857 ----

      Tcl_Obj *CONST objv[];    /* Argument objects. */

  {

      int varIndex, option, i, length;

! #define MAX_STRINGS 11

      char *index, *string, *strings[MAX_STRINGS+1];

      static char *options[] = {

        "append", "appendstrings", "get", "get2", "length", "length2",



The patch has been applied.
welch Closed ticket [218454ffff]. [History diff]2000-10-26 08:22:16
Log in (anonymous is fine) to add a comment.