diff options
author | nijtmans <nijtmans> | 2010-12-05 22:27:00 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-12-05 22:27:00 (GMT) |
commit | aaf249e2a83d00881890e2bba9bc1ede29309179 (patch) | |
tree | ae502d94f6daacc8ac7743e389dd36dd0fe2081b | |
parent | 65b034684f4c5d543f928aa9a81c238291dd74d1 (diff) | |
download | tcl-aaf249e2a83d00881890e2bba9bc1ede29309179.zip tcl-aaf249e2a83d00881890e2bba9bc1ede29309179.tar.gz tcl-aaf249e2a83d00881890e2bba9bc1ede29309179.tar.bz2 |
[Bug 3127687] Triggers FORTIFY_SOURCE buffer overflow detection
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 8 |
2 files changed, 9 insertions, 4 deletions
@@ -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, |