Artifacts Associated With Ticket 805605ffffffffffffffffffffffffffffffffff
Ticket change [0a3c208828] (rid 113781) by ronaldd on 2003-09-13 14:02:53:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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; } - foundin initialized to: "obsolete: 8.4.4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "ronaldd"
- subsystem initialized to: "None"
- title initialized to: "incorrect use of isspace in tclWinPipe.c"
- type initialized to: "Bug"
Ticket change [10270af77f] (rid 94919) by dkf on 2003-09-14 01:16:05:
- assignee changed to: "andreas_kupries"
- subsystem changed to: "27. Channel Types"
Ticket change [9d70265db3] (rid 96306) by dgp on 2003-10-03 04:52:30:
- priority changed to: "8"
Ticket change [ef838dd665] (rid 109007) by andreas_kupries on 2003-10-22 06:26:08:
- closedate changed to: "2003-10-21T23:26:08"
- closer changed to: "andreas_kupries"
- 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.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "andreas_kupries"