summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPipe.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-07-02 16:22:18 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-07-02 16:22:18 (GMT)
commit365f431b636ec6b553ea127587a92b9956003f0a (patch)
treea55b666665dee68835dc95f84554c3895f1cbcb2 /unix/tclUnixPipe.c
parenteb57e9b4301023a8a734e2d802a7e2c1f122bce1 (diff)
downloadtcl-365f431b636ec6b553ea127587a92b9956003f0a.zip
tcl-365f431b636ec6b553ea127587a92b9956003f0a.tar.gz
tcl-365f431b636ec6b553ea127587a92b9956003f0a.tar.bz2
1189293 Make '<<' redirects binary safe. Don't use strlen() (or equivalent)
to find end of written data bytes.
Diffstat (limited to 'unix/tclUnixPipe.c')
-rw-r--r--unix/tclUnixPipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index 3a4005c..829a4a6 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -213,7 +213,7 @@ TclpCreateTempFile(contents)
if (contents != NULL) {
native = Tcl_UtfToExternalDString(NULL, contents, -1, &dstring);
- if (write(fd, native, strlen(native)) == -1) {
+ if (write(fd, native, Tcl_DStringLength(&dstring)) == -1) {
close(fd);
Tcl_DStringFree(&dstring);
return NULL;