Skip to content
Tcl Source Code History Of Ticket 805605ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 805605ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 805605ffffffffffffffffffffffffffffffffff

  1. Ticket change [0a3c208828] (rid 113781) by ronaldd on 2003-09-13 14:02:53:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Applies to Tcl Version 8.4.4 
      
      In tclWinPipe.c, Line 1588
      if (isspace(*start)) { /* INTL: ISO space. */
      a signed char is passed to isspace.  
      
      For two reasons, this is incorrect:
      
      1. The string pointed to by 'start' is 
      suppoed to be UTF-8. It does not make 
      sense to pass the bytes of an UTF-8 
      string to isspace unless they represent 
      a single character (i. e. are in the 
      range 1 - 127)
      
      2. Passing a negative value (*start is a 
      signed char!) to isspace causes the VC6 
      and VC.NET runtime libraries to access 
      memory outside the lookup-table used by 
      the ctype.h functions.
      
      Symptoms and consequences:
      1. Access to undefined memory locations
      2. Arguments may be quoted unneccessarily 
         (because isspace returns incorrectly true)
      3. Assertion fails in Debug builds of 
         VC.NET 2003 in main.test (e. g. Main-1.3)
         "File istype.c, Line 68:
          Expression (unsigned)(c+1) <= 256"
      
      How to reproduce:
      for 1.: Assembly level debugger or code inspection 
               (ctype.h for VC6, istype.c for VC.NET 2003)
      for 2.: Code inspection
      for 3.: with VC.NET run
      nmake -f makefile.vc OPTS=threads,symbols
      nmake -f makefile.vc OPTS=threads,symbols test
      The assertion should produce four dialog boxes
      
      How to fix:
      The following changes work for VC.NET and should be
      portable across all compilers:
      --- tclWinPipe.c-orig   2003-09-13 15:46:04
      +++ tclWinPipe.c        2003-09-13 15:48:47
      @@ -1584,8 +1584,11 @@
              if (arg[0] == '\0') {
                  quote = 1;
              } else {
      -           for (start = arg; *start != '\0'; start++) {
      -               if (isspace(*start)) { /* INTL: ISO
      space. */
      +           int count;
      +           for (start = arg; *start != '\0'; start +=
      count) {
      +               Tcl_UniChar ch;
      +               count = Tcl_UtfToUniChar(start, &ch);
      +               if (Tcl_UniCharIsSpace(ch)) { /* INTL:
      ISO space. */
                          quote = 1;
                          break;
                      }
      
      
    4. foundin initialized to: "obsolete: 8.4.4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "ronaldd"
    9. subsystem initialized to: "None"
    10. title initialized to: "incorrect use of isspace in tclWinPipe.c"
    11. type initialized to: "Bug"
  2. Ticket change [10270af77f] (rid 94919) by dkf on 2003-09-14 01:16:05:

    1. assignee changed to: "andreas_kupries"
    2. subsystem changed to: "27. Channel Types"
  3. Ticket change [9d70265db3] (rid 96306) by dgp on 2003-10-03 04:52:30:

    1. priority changed to: "8"
  4. Ticket change [ef838dd665] (rid 109007) by andreas_kupries on 2003-10-22 06:26:08:

    1. closedate changed to: "2003-10-21T23:26:08"
    2. closer changed to: "andreas_kupries"
    3. icomment:
      Logged In: YES 
      user_id=75003
      
      Change accepted and committed to head of 8.4 branch.
      
      One small change: 'Tcl_Unichar ch' was moved outside of the 
      for loop, just before the loop, after the 'int count'.
      
      And committed into the head.
      
      
      
    4. login: "andreas_kupries"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "andreas_kupries"