summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-08-19 10:07:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-08-19 10:07:43 (GMT)
commitd7dcac6b8685a1439f738accf3e4b9ef13c80aeb (patch)
tree7e1382dc6f025332c5c57b0308867be4741f09e9
parente9db3af7891146387c385294511538225293fab1 (diff)
downloadtcl-d7dcac6b8685a1439f738accf3e4b9ef13c80aeb.zip
tcl-d7dcac6b8685a1439f738accf3e4b9ef13c80aeb.tar.gz
tcl-d7dcac6b8685a1439f738accf3e4b9ef13c80aeb.tar.bz2
* generic/tclTrace.c (TraceExecutionObjCmd, TraceCommandObjCmd)
(TraceVariableObjCmd): [Patch 3048354]: Use memcpy() instead of strcpy() to avoid buffer overflow; we have the correct length of data to copy anyway since we've just allocated the target buffer.
-rw-r--r--ChangeLog19
-rw-r--r--generic/tclTrace.c8
2 files changed, 17 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a9926b..be8cdd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+2010-08-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tclTrace.c (TraceExecutionObjCmd, TraceCommandObjCmd)
+ (TraceVariableObjCmd): [Patch 3048354]: Use memcpy() instead of
+ strcpy() to avoid buffer overflow; we have the correct length of data
+ to copy anyway since we've just allocated the target buffer.
+
2010-08-18 Jan Nijtmans <nijtmans@users.sf.net>
- * tools/genStubs.tcl [Patch 3034251] backport ttkGenStubs.tcl features to
- genStubs.tcl, partly: remove unneeded ifdeffery and put C++ guard around
- stubs pointer definition.
- * generic/*Decls.h (regenerated)
+ * tools/genStubs.tcl: [Patch 3034251]: Backport ttkGenStubs.tcl
+ features to genStubs.tcl, partly: remove unneeded ifdeffery and put
+ C++ guard around stubs pointer definition.
+ * generic/*Decls.h: (regenerated)
2010-08-18 Miguel Sofer <msofer@users.sf.net>
* generic/tclBasic.c: New redesign of [tailcall]: find
@@ -11,8 +18,8 @@
* generic/tclInt.h: contains the proper info [Bug 3047235]
* generic/tclNamesp.c:
- * generic/tclCmdAH.c (TclNRTryObjCmd): block tailcalling out of
- the body of a non-bc'ed [try], [Bug 3046594]
+ * generic/tclCmdAH.c (TclNRTryObjCmd): [Bug 3046594]: Block
+ tailcalling out of the body of a non-bc'ed [try].
* generic/tclBasic.c: Redesign of [tailcall] to
* generic/tclCmdAH.c: (a) fix [Bug 3047235]
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 6f1379f..d3a6093 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTrace.c,v 1.58 2010/02/24 10:45:04 dkf Exp $
+ * RCS: @(#) $Id: tclTrace.c,v 1.59 2010/08/19 10:07:43 dkf Exp $
*/
#include "tclInt.h"
@@ -478,7 +478,7 @@ TraceExecutionObjCmd(
TCL_TRACE_LEAVE_DURING_EXEC)) {
flags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC);
}
- strcpy(tcmdPtr->command, command);
+ memcpy(tcmdPtr->command, command, length+1);
name = Tcl_GetString(objv[3]);
if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
tcmdPtr) != TCL_OK) {
@@ -711,7 +711,7 @@ TraceCommandObjCmd(
tcmdPtr->length = length;
tcmdPtr->refCount = 1;
flags |= TCL_TRACE_DELETE;
- strcpy(tcmdPtr->command, command);
+ memcpy(tcmdPtr->command, command, length+1);
name = Tcl_GetString(objv[3]);
if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
tcmdPtr) != TCL_OK) {
@@ -911,7 +911,7 @@ TraceVariableObjCmd(
}
ctvarPtr->traceCmdInfo.length = length;
flags |= TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT;
- strcpy(ctvarPtr->traceCmdInfo.command, command);
+ memcpy(ctvarPtr->traceCmdInfo.command, command, length+1);
ctvarPtr->traceInfo.traceProc = TraceVarProc;
ctvarPtr->traceInfo.clientData = &ctvarPtr->traceCmdInfo;
ctvarPtr->traceInfo.flags = flags;