Skip to content
Tcl Source Code History Of Ticket 495207ffffffffff
Login

History Of Ticket 495207ffffffffff

Artifacts Associated With Ticket 495207ffffffffff

  1. Ticket change [919d911e46] (rid 120647) by jenglish on 2001-12-19 22:49:30:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      [subst] produces garbage when the input contains an
      incomplete command substitution:
      
        set lb {[}
        set a [subst $lb]
      
      First saw this in Tcl 8.4 alpha something (CVS
      snapshot), but the bug seems to go back as far as Tcl
      8.0.
      
      Also:
      subst {[set a 1};# missing "]"
      
      sets $a to 1 and returns 1; this should probably be an
      error instead.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "jenglish"
    9. subsystem initialized to: "None"
    10. title initialized to: "[subst] error on "[""
    11. type initialized to: "Bug"
  2. Ticket change [c2d28950ae] (rid 111544) by dgp on 2001-12-20 09:24:41:

    1. assignee changed to: "dkf"
    2. foundin changed to: "obsolete: 8.4a4"
    3. subsystem changed to: "18. Commands M-Z"
    4. title changed to: "[subst] error on "[""
  3. Ticket change [6fa1e93fd8] (rid 100346) by dkf on 2001-12-21 03:19:33:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Looks like memory corruption in the hairiest bit of the parser (i.e. when the TCL_BRACKET_TERM flag is set);
      is it *really* going past the end of the string?!? In any case, this is outside my domain...
      
      Upped the severity as [subst] is sometimes used on untrusted data (though it should not be a general problem 
      because anyone not setting -nocommands or controlling what has brackets is asking for trouble anyway) and might 
      have some impact on some important Tcl applications (like webservers...)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. subsystem changed to: "45. Parsing and Eval"
    7. title changed to: "[subst] error on [ = buffer overrun?"
    8. username: "dkf"
  4. Add attachment "subst.patch" [671ac00e29] (rid 102845) by msofer on 2001-12-22 22:15:45.

  5. Ticket change [f6d386b8a5] (rid 130372) by msofer on 2001-12-22 22:15:45:

    1. assignee changed to: "dkf"
    2. icomment:
      
      
      File Added - 15048: subst.patch
      
      Logged In: YES 
      user_id=148712
      
      The error seems to be in Tcl_SubstObj(): it *assumes* that
      bracket terms are properly terminated, and misbehaves when
      this assumption is not verified.
      I am enclosing a patch that resolves this issue. I am not
      sure if it behaves properly though, I have a question as to
      what should happen in case of a misformatted bracket term.
      Specifically: if we request
         subst {[set a 1} ;# missing "]" 
      this patch causes a to be set to 1, and *then* returns an
      error. Should it instead return with an error *before*
      setting a?
      
      Donal, I'm assigning back to you for comment on this issue. 
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  6. Ticket change [5c0846fe4e] (rid 118429) by jenglish on 2001-12-22 23:53:08:

    1. icomment:
      Logged In: YES 
      user_id=68433
      
      
      >Should it instead return with an error *before* setting a?
      
      That's what Tcl 7.6 does:
      | % subst {[set a 1}
      | missing close-bracket
      | % set a
      | can't read "a": no such variable
      
      Also, subst {[set a 1] [ set b 2} sets a, then raises
      an error before setting b (in 7.6).
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  7. Ticket change [2e3e27e457] (rid 119193) by dkf on 2001-12-27 19:24:22:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Question: why isn't the missing close bracket causing Tcl_EvalEx() to
      return TCL_ERROR? It seems to me that there is something deeply odd
      going on here, and that it seems deeply suspicious that the lack of a
      bracket gets treated as a normal return...
      
      (Note that there is definitely a need for something to be done here to
      improve on the current situation w.r.t. handling of error cases, and
      possibly add some kind of pre-parsing to allow for faster [subst]ing the
      second time a string is fed through, but that's something for another
      time.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  8. Ticket change [5b9112a947] (rid 118351) by hobbs on 2002-02-26 03:43:15:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      I don't think an error should be thrown here ...  Then 
      again, I'm not sure what change in behavior would be "most 
      compatible", but preventing the buffer overrun is important.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  9. Ticket change [348b559462] (rid 106774) by hobbs on 2002-02-26 03:45:50:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Actually, let me change my mind, since 7.6 does actually 
      throw an error "missing close-bracket".  I think we should 
      try to get back to 7.6-like behavior.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  10. Add attachment "subst.patch2" [c201f07de3] (rid 111426) by msofer on 2002-02-26 06:11:21.

  11. Ticket change [59b2cd952b] (rid 118009) by msofer on 2002-02-26 06:11:21:

    1. icomment:
      
      
      File Added - 18428: subst.patch2
      
      Logged In: YES 
      user_id=148712
      
      This subst.patch2 reproduces the 7.6 behaviour.
      
      Note that the unpatched tcl passes the tests under tcltest,
      although it does overrun the buffer at the command line. New
      tests should be devised ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  12. Ticket change [9a85b831ea] (rid 110957) by msofer on 2002-02-26 06:18:44:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Patch committed; lowering priority but not closing yet: I'll
      try to find better tests for this.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. priority changed to: "3 Low"
    5. resolution changed to: "Fixed"
    6. username: "msofer"
  13. Ticket change [f7d913f30c] (rid 91442) by royterry on 2002-03-22 05:00:01:

    1. icomment:
      Logged In: YES 
      user_id=146884
      
      COMMENT ADDED AT REQUEST OF Don Porter by Roy Terry
      In article <[email protected]>, Roy Terry 
      wrote:
      > % time {lindex [split this,that ,] 0]} 1000
      > Tcl_AppendStringsToObj called with shared object
      > 
      > abnormal program termination
      
      Probably a problem with the fix for Tcl Bug 495207.  Please 
      post
      this example as a followup comment there.
      
      
      
    2. login: "royterry"
    3. mimetype: "text/plain"
    4. username: "royterry"
  14. Ticket change [d8fa89e0cc] (rid 107532) by dgp on 2002-03-22 05:25:17:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Looks like I misdiagnosed it.
      Really a bug in the new
      TclGetIntForIndex() routine.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Ticket change [73d2102e53] (rid 105097) by dgp on 2002-03-22 06:30:05:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      See Tcl Bug 533364 for the new bug.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  16. Ticket change [115bc9fd08] (rid 95121) by msofer on 2002-08-08 22:29:59:

    1. closedate changed to: "2002-08-08T15:29:59"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Tests added to HEAD
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "msofer"