Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 60e2f44bfc1473ea9fc96bbc4864156c3006efa2
Ticket: 218998ffffffffffffffffffffffffffffffffff
Insufficient error handling generates exception
User & Date: nobody on 2000-10-26 01:09:07
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3752 Bug
    Version: 8.2.2
    SubmitDate: '1999-12-02'
    LastModified: '1999-12-03'
    Severity: CRIT
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    Machine: Sun Ultra Sparc
    FixedDate: '1999-12-03'
    FixedInVersion: 8.2.3
    ClosedDate: '2000-10-25'
    
    
    Name: Q. Alex Zhao
    
    
    Comments:
    
    If "catch" catches an error, n is undefined, causing "if {$n == 0} ..." to fail. Use "elseif" should fix the problem.
    
    
    ReproducibleScript:
    
    Use the http package to fetch a Web page.
    
    
    ObservedBehavior:
    
    can't read "n": no such variable
    
        while executing
    
    "if {$n == 0} {
    
                set state(state) body
    
                if {![regexp -nocase ^text $state(type)]} {
    
                    # Turn off conversions for non-text data
    
                    fconfigure $s ..."
    
        (procedure "http::Event" line 14)
    
        invoked from within
    
    "http::Event ::http::722"
    
    
    DesiredBehavior:
    
    no error
    
    
    Patch:
    
    *** http.tcl.old        Fri Nov 19 18:10:08 1999
    
    --- http.tcl    Thu Dec  2 13:13:30 1999
    
    ***************
    
    *** 449,456 ****
    
          if {[string equal $state(state) "header"]} {
    
            if {[catch {gets $s line} n]} {
    
                Finish $token $err
    
    !       }
    
    !       if {$n == 0} {
    
                set state(state) body
    
                if {![regexp -nocase ^text $state(type)]} {
    
                    # Turn off conversions for non-text data
    
    --- 449,455 ----
    
          if {[string equal $state(state) "header"]} {
    
            if {[catch {gets $s line} n]} {
    
                Finish $token $err
    
    !       } elseif {$n == 0} {
    
                set state(state) body
    
                if {![regexp -nocase ^text $state(type)]} {
    
                    # Turn off conversions for non-text data
    
    
    PatchFiles:
    
    http.tcl
    
    
    
    
    Good fix, wrong problem (user was using 8.1.1 actually).
    The necessary fixes have been applied for 8.2.3/8.3. 
    -- 12/03/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.2.2"
  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: "Insufficient error handling generates exception"
  11. type changed to: "Bug"