Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d176af2a49b74406d93b27219ad2e813debcf594
Ticket: 218453ffffffffffffffffffffffffffffffffff
Patch for missing error check in TclGetDefaultStdChannel on
User & Date: nobody on 2000-10-26 01:00:34
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 581 Bug
    Version: 8.1a2
    SubmitDate: '1998-05-21'
    LastModified: '1998-11-19'
    Severity: SER
    Status: Released
    Submitter: hershey
    ChangedBy: rjohnson
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1998-11-19'
    FixedInVersion: 8.0.5
    ClosedDate: '2000-10-25'
    
    
    In Tcl 8.1a2, on Windows, the function TclGetDefaultStdChannel, in
    
    win/tclWinChan.c, does not check the return value of
    
    Tcl_MakeFileChannel before passing it to Tcl_SetChannelOption.
    
    However, it is possible, if somewhat unlikely, for Tcl_MakeFileChannel
    
    to fail, when there is some confusion over handles and the mode in
    
    which they were opened.  It is better to return an indication of
    
    failure than to get a segmentation violation.
    
    
    
    I have appended the obvious patch.
    
    
    
    Ian Taylor
    
    [email protected]
    
    
    
    *** tclWinChan.c.~1~    Fri Apr 10 17:47:12 1998
    
    --- tclWinChan.c        Fri Apr 10 17:47:17 1998
    
    *************** TclpGetDefaultStdChannel(type)
    
    *** 1180,1185 ****
    
    --- 1180,1188 ----
    
          }
    
      
    
          channel = Tcl_MakeFileChannel(handle, mode);
    
    +     if (channel == NULL) {
    
    +       return NULL;
    
    +     }
    
      
    
          /*
    
           * Set up the normal channel options for stdio handles.
    
    
    
    
    
    This bug also appeared in Tcl 8.0.  I fixed it in version 8.0.5.  The change will propagate up to 8.1.  - Ray
    
    
    
  4. foundin changed to: "obsolete: 8.1a2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    Patch for missing error check in TclGetDefaultStdChannel on 
    
  11. type changed to: "Bug"