summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2006-09-25 21:55:27 (GMT)
committerandreas_kupries <akupries@shaw.ca>2006-09-25 21:55:27 (GMT)
commit9ca74c27f3f89bb08b044b9bea127f0aa23fa9d5 (patch)
treec48bfbd4f371c2fb3e16911a80245bb14d6bbf00
parent0cd4bfa8dac2621beee4fa3bf1cee45fa3c0d601 (diff)
downloadtcl-9ca74c27f3f89bb08b044b9bea127f0aa23fa9d5.zip
tcl-9ca74c27f3f89bb08b044b9bea127f0aa23fa9d5.tar.gz
tcl-9ca74c27f3f89bb08b044b9bea127f0aa23fa9d5.tar.bz2
* generic/tclIO.c (Tcl_StackChannel): Fixed [SF Tcl Bug 1564642],
aka coverity #51. Extended loop condition, added checking for NULL to prevent seg.fault.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclIO.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a365fc9..16ee13f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-09-25 Andreas Kupries <andreask@activestate.com>
+ * generic/tclIO.c (Tcl_StackChannel): Fixed [SF Tcl Bug 1564642],
+ aka coverity #51. Extended loop condition, added checking for
+ NULL to prevent seg.fault.
+
+2006-09-25 Andreas Kupries <andreask@activestate.com>
+
* doc/package.n: Fixed nits reported by Daniel Steffen in the
TIP#268 changes.
diff --git a/generic/tclIO.c b/generic/tclIO.c
index b9c3454..f0553dd 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.107 2006/04/05 00:18:50 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.108 2006/09/25 21:55:27 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -1274,7 +1274,7 @@ Tcl_StackChannel(
statePtr = (ChannelState *) tsdPtr->firstCSPtr;
prevChanPtr = ((Channel *) prevChan)->state->topChanPtr;
- while (statePtr->topChanPtr != prevChanPtr) {
+ while ((statePtr != NULL) && (statePtr->topChanPtr != prevChanPtr)) {
statePtr = statePtr->nextCSPtr;
}