summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2011-01-25 08:49:59 (GMT)
committernijtmans <nijtmans>2011-01-25 08:49:59 (GMT)
commitd8186ef5bf93efe14d5a56b994cf7cf47fb1e0b7 (patch)
tree05ebd64c7a56b5c6c3ba5b75b9e88c284d137a77 /win/tkWinWm.c
parentc7e2c247fb4c5fa32a2335c59b72e25b83a3ee64 (diff)
downloadtk-d8186ef5bf93efe14d5a56b994cf7cf47fb1e0b7.zip
tk-d8186ef5bf93efe14d5a56b994cf7cf47fb1e0b7.tar.gz
tk-d8186ef5bf93efe14d5a56b994cf7cf47fb1e0b7.tar.bz2
[Patch #3129527]: Fix buffer overflow w/ GCC 4.5 and -D_FORTIFY_SOURCE=2.
Just the strcpy->memcpy part, to prevent anything like [Bug #3164879]
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index f4d1f8b..96447dc 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.54.2.30 2009/01/16 23:46:50 andreas_kupries Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.54.2.31 2011/01/25 08:49:59 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -4565,7 +4565,7 @@ WmProtocolCmd(tkwin, winPtr, interp, objc, objv)
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
protPtr->interp = interp;
- strcpy(protPtr->command, cmd);
+ memcpy(protPtr->command, cmd, cmdLength + 1);
}
return TCL_OK;
}