Skip to content
Tcl Source Code History Of Ticket 218905
Login

History Of Ticket 218905

Artifacts Associated With Ticket 218905

  1. Ticket change [cceb47b58b] (rid 95792) by nobody on 2000-10-26 01:07:37:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2623 Bug
      Version: 8.2
      SubmitDate: '1999-08-31'
      LastModified: '1999-11-18'
      Severity: CRIT
      Status: Released
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Windows NT
      Machine: X86
      FixedDate: '1999-11-18'
      FixedInVersion: 8.2.1
      ClosedDate: '2000-10-25'
      
      
      Name:
      
      Matt Newman
      
      
      CustomShell:
      
      The above patch, plus the tclPosixStr.c patch plus a patch to fix the -translation and -eofchar bugs in GetOption code (to be submitted sortly)
      
      
      Comments:
      
      A low risk patch that urgently needs to be applied.
      
      
      ObservedBehavior:
      
      Tcl_ReadChars does not allocate a Tcl_Obj for its data, but instead uses
      
          the existing Tcl Result OBJ. This is normally relatively safe, but bad
      
          practice.
      
      
          How ever with stacked channels the underlying channel may issue
      
          Tcl_Eval's during the read processing, which causes a complex corruption
      
          of the Tcl_Obj that Tcl_ReadChars is using - and because of the way it
      
          works this almost *ALWAYS* will cause a core dump.
      
      
          This behaviour was first observed whilst testing the
      
          shortly-to-be-released TLS (aka SSL) extension - but the exposure exists
      
          for *ALL* stacked channels that may perform Tcl_Evals.
      
      
      DesiredBehavior:
      
      No bugs - no crashs.
      
      
      Patch:
      
      Index: tclIOCmd.c
      
      ===================================================================
      
      RCS file: /cvs/tcl/tcl8.2/generic/tclIOCmd.c,v
      
      retrieving revision 1.1.1.1
      
      diff -c -r1.1.1.1 tclIOCmd.c
      
      *** tclIOCmd.c  1999/08/19 12:32:00     1.1.1.1
      
      --- tclIOCmd.c  1999/08/23 16:59:41
      
      ***************
      
      *** 350,361 ****
      
                }
      
            }
      
      
      !     resultPtr = Tcl_GetObjResult(interp);
      
            charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0);
      
            if (charactersRead < 0) {
      
              Tcl_ResetResult(interp);
      
              Tcl_AppendResult(interp, "error reading \"", name, "\": ",
      
                      Tcl_PosixError(interp), (char *) NULL);
      
              return TCL_ERROR;
      
            }
      
      
      --- 350,363 ----
      
                }
      
            }
      
      
      !     resultPtr = Tcl_NewObj();
      
      !     Tcl_IncrRefCount(resultPtr);
      
            charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0);
      
            if (charactersRead < 0) {
      
              Tcl_ResetResult(interp);
      
              Tcl_AppendResult(interp, "error reading \"", name, "\": ",
      
                      Tcl_PosixError(interp), (char *) NULL);
      
      +       Tcl_DecrRefCount(resultPtr);
      
              return TCL_ERROR;
      
            }
      
      
      ***************
      
      *** 372,377 ****
      
      --- 374,381 ----
      
                  Tcl_SetObjLength(resultPtr, length - 1);
      
              }
      
            }
      
      +     Tcl_SetObjResult(interp, resultPtr);
      
      +     Tcl_DecrRefCount(resultPtr);
      
            return TCL_OK;
      
        }
      
      
      PatchFiles:
      
      generic/tclIOCmd.c
      
      
      
      
      in 8.2.1 
      -- 11/18/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "62. (unused)"
    10. title initialized to: "Tcl_ReadChars is unsafe for stacked channels"
    11. type initialized to: "Bug"
  2. Ticket change [05000e9982] (rid 88974) by welch on 2000-10-26 08:31:15:

    1. closedate changed to: "2000-10-26T01:31:15"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [e03ec01922] (rid 115152) by dgp on 2001-04-03 06:31:21:

    1. closedate changed to: "2001-04-02T23:31:21"
    2. closer changed to: "dgp"
    3. subsystem changed to: "25. Channel System"