summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-11-23 19:29:19 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-11-23 19:29:19 (GMT)
commit7aaca6e2af565920f71bb68dbd2182b4ca82ed90 (patch)
tree23441626de562e647d4b66101f877ed275d59541
parent3c9a69481dd1285a19f13ee18f5f4cc42cc1d877 (diff)
downloadtcl-7aaca6e2af565920f71bb68dbd2182b4ca82ed90.zip
tcl-7aaca6e2af565920f71bb68dbd2182b4ca82ed90.tar.gz
tcl-7aaca6e2af565920f71bb68dbd2182b4ca82ed90.tar.bz2
* generic/tclIO.c: Backport of fix for [Bug 2333466].
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclIO.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 53e654b..3acfaed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-23 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tclIO.c: Backport of fix for [Bug 2333466].
+
2008-11-18 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tcl.decls: Fix signature and implementation of
diff --git a/generic/tclIO.c b/generic/tclIO.c
index b30385f..d1c7b6b 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.137.2.6 2008/05/23 21:10:43 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.137.2.7 2008/11/23 19:29:19 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -9810,8 +9810,11 @@ Tcl_IsChannelExisting(
name = statePtr->channelName;
}
+ /* Bug 2333466. Include \0 in the compare to prevent partial matching
+ * on prefixes.
+ */
if ((*chanName == *name) &&
- (memcmp(name, chanName, (size_t) chanNameLen) == 0)) {
+ (memcmp(name, chanName, (size_t) chanNameLen+1) == 0)) {
return 1;
}
}