Skip to content
Tcl Source Code History Of Ticket 1813528fffffffff
Login

History Of Ticket 1813528fffffffff

Artifacts Associated With Ticket 1813528fffffffff

  1. Ticket change [a5073e5021] (rid 110303) by mistachkin on 2007-10-15 05:34:10:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      This bug is present in both 8.4 and 8.5 (HEAD).
      
      In Tcl_ParseBraces, near line 1671 in HEAD we see:
      
      src = start;
      
      A couple lines later, src is updated in a loop:
      
      while (++src, --numBytes) {
      <snip>
      
      If this loop terminates due to numBytes being zero, src may point one character beyond the end of the string.
      
      The real problem arises in the error handling code that attempts to search backwards for the open brace inside of a comment, near line 1788:
      
      for (; src > start; src--) {
          switch (*src) {
      <snip>
      
      At the point the switch statement is executed, src still may point one character beyond the end of the string.
      
      A possible fix for this issue is to change the loop as follows:
      
      for (src--; src > start; src--) {
          switch (*src) {
      <snip>
      
      
    4. foundin initialized to: "obsolete: 8.5b1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "mistachkin"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to:
      off-by-one error in parser unbalanced brace in comment check
      
    12. type initialized to: "Bug"
  2. Ticket change [a59f47578f] (rid 110409) by msofer on 2007-10-15 20:29:30:

    1. closedate changed to: "2007-10-15T13:29:30"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      Originator: NO
      
      Thx, fixed by changing the second loop to
        while(--src > start) { ... } 
      
      The bug was possibly harmless in most situations - the next character would almost always have been a terminal \0.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"