diff options
author | dgp <dgp@users.sourceforge.net> | 2012-07-05 13:51:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-07-05 13:51:29 (GMT) |
commit | 22494dcc59a1b43be12abc4288197002cf2b8bf7 (patch) | |
tree | 1f7802c2615d135e2dcce19a4ea4daa61f172c0c /win | |
parent | 88acd72e58f591661319bbc034aaf33d2761ecfb (diff) | |
parent | 4919dfddfb725fa6b90d1f95b3ff26b8fd8b76a4 (diff) | |
download | tcl-22494dcc59a1b43be12abc4288197002cf2b8bf7.zip tcl-22494dcc59a1b43be12abc4288197002cf2b8bf7.tar.gz tcl-22494dcc59a1b43be12abc4288197002cf2b8bf7.tar.bz2 |
1189293 Make "<<" binary safe.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinPipe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index b1affe3..0ef8d19 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -685,6 +685,7 @@ TclpCreateTempFile( if (contents != NULL) { DWORD result, length; const char *p; + int toCopy; /* * Convert the contents from UTF to native encoding @@ -692,7 +693,8 @@ TclpCreateTempFile( native = Tcl_UtfToExternalDString(NULL, contents, -1, &dstring); - for (p = native; *p != '\0'; p++) { + toCopy = Tcl_DStringLength(&dstring); + for (p = native; toCopy > 0; p++, toCopy--) { if (*p == '\n') { length = p - native; if (length > 0) { |