summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-12-05 22:27:00 (GMT)
committernijtmans <nijtmans>2010-12-05 22:27:00 (GMT)
commit648e6b6595bf2d0353b9633eab587b20bdda7f8a (patch)
treeae502d94f6daacc8ac7743e389dd36dd0fe2081b
parent16c3a9beaa176b53e6daaaf5e0a04f9ed78366ff (diff)
downloadtcl-648e6b6595bf2d0353b9633eab587b20bdda7f8a.zip
tcl-648e6b6595bf2d0353b9633eab587b20bdda7f8a.tar.gz
tcl-648e6b6595bf2d0353b9633eab587b20bdda7f8a.tar.bz2
[Bug 3127687] Triggers FORTIFY_SOURCE buffer overflow detection
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCmdMZ.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8199e1e..7df850f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclCmdMZ.c: [Bug 3127687] Triggers FORTIFY_SOURCE
+ buffer overflow detection
+
2010-11-03 Jeff Hobbs <jeffh@ActiveState.com>
Backported from 8.6 (see 2010-08-04).
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 753f0c1..ee1f128 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.32 2010/04/06 07:45:56 vasiljevic Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.33 2010/12/05 22:27:00 nijtmans Exp $
*/
#include "tclInt.h"
@@ -3340,7 +3340,7 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv)
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,
(ClientData) tcmdPtr) != TCL_OK) {
@@ -3572,7 +3572,7 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv)
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,
(ClientData) tcmdPtr) != TCL_OK) {
@@ -3791,7 +3791,7 @@ TclTraceVariableObjCmd(interp, optionIndex, objc, objv)
}
tvarPtr->length = length;
flags |= TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT;
- strcpy(tvarPtr->command, command);
+ memcpy(tvarPtr->command, command, length + 1);
name = Tcl_GetString(objv[3]);
flagMask = TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY;
varPtr = TclLookupVar(interp, name, NULL,