Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-18
21:52 • Ticket [218867ffff] info complete (Bug 2382) again status still Closed with ... artifact: a28ecb891a user: dgp
2000-10-26
08:30 • Closed ticket [218867ffff]. artifact: 91e683e680 user: welch
01:06 • New ticket [218867ffff]. artifact: 556941a838 user: nobody

info complete (Bug 2382) again

Closed / Fixed218867ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:06:56
OriginalBugID: 2466 Bug
Version: 8.2b1
SubmitDate: '1999-07-28'
LastModified: '1999-07-30'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 2382
OS: Other
Machine: NA
FixedDate: '1999-07-30'
FixedInVersion: 8.2b2
ClosedDate: '2000-10-25'


Name:

Peter Spjuth



ReproducibleScript:

This is a new patch to replace the broken patch in Bug 2382.

    

    My mistake with the first patch, apart from not testing it properly,

    was to assume that Tcl_ParseCommand always filled in parsePtr->term.

    In some cases it did not, so when accessing *nested.term, there was 

    a big chance of getting a Segmentation Fault.

    

    This patch changes Tcl_ParseCommand to always fill in that value, and

    thus making it safe to use it in ParseTokens.

    

    This time I have tested the patch, and it gets through the test suite on

    both Win98 and Solaris.



Patch:

Index: tclParse.c

===================================================================

RCS file: /cvsroot/tcl/generic/tclParse.c,v

retrieving revision 1.10

diff -c -r1.10 tclParse.c

*** tclParse.c1999/07/23 23:40:291.10

--- tclParse.c1999/07/27 20:24:59

***************

*** 260,265 ****

--- 260,266 ----

      parsePtr->tokensAvailable = NUM_STATIC_TOKENS;

      parsePtr->string = string;

      parsePtr->end = string + numBytes;

+     parsePtr->term = parsePtr->end;

      parsePtr->interp = interp;

      parsePtr->incomplete = 0;

      parsePtr->errorType = TCL_PARSE_SUCCESS;

***************

*** 372,377 ****

--- 373,379 ----

      break;

  }

  if ((type & terminators) != 0) {

+     parsePtr->term = src;

      src++;

      break;

  }

***************

*** 455,460 ****

--- 457,463 ----

  }

  

  if ((type & terminators) != 0) {

+     parsePtr->term = src;

      src++;

      break;

  }

***************

*** 607,613 ****

  if (nested.tokenPtr != nested.staticTokens) {

      ckfree((char *) nested.tokenPtr);

  }

! if ((src[-1] == ']') && !nested.incomplete) {

      break;

  }

  if (src == parsePtr->end) {

--- 610,616 ----

  if (nested.tokenPtr != nested.staticTokens) {

      ckfree((char *) nested.tokenPtr);

  }

! if ((*nested.term == ']') && !nested.incomplete) {

      break;

  }

  if (src == parsePtr->end) {



PatchFiles:

tclParse.c
welch Closed ticket [218867ffff]. [History diff]2000-10-26 08:30:15
dgp Ticket [218867ffff]: 3 changes [History diff]2001-04-18 21:52:14
Log in (anonymous is fine) to add a comment.