summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixWm.c
diff options
context:
space:
mode:
authornijtmans <nijtmans@noemail.net>2011-01-25 08:31:36 (GMT)
committernijtmans <nijtmans@noemail.net>2011-01-25 08:31:36 (GMT)
commitf8a621934a7c9fb15ff83ee62cc99875605a9f46 (patch)
tree5102c8db204c464ad05ae31f1603514f24068789 /unix/tkUnixWm.c
parent2164750b0051a010f42a993faf39582257aa8677 (diff)
downloadtk-f8a621934a7c9fb15ff83ee62cc99875605a9f46.zip
tk-f8a621934a7c9fb15ff83ee62cc99875605a9f46.tar.gz
tk-f8a621934a7c9fb15ff83ee62cc99875605a9f46.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] FossilOrigin-Name: eea2c8aa548422c8fbabaaf713485156bf3c44f2
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r--unix/tkUnixWm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index e12f3a6..73d62c2 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.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: tkUnixWm.c,v 1.58.2.8 2010/02/16 21:15:11 nijtmans Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.58.2.9 2011/01/25 08:31:37 nijtmans Exp $
*/
#include "tkUnixInt.h"
@@ -3020,7 +3020,7 @@ WmProtocolCmd(
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
protPtr->interp = interp;
- strcpy(protPtr->command, cmd);
+ memcpy(protPtr->command, cmd, cmdLength + 1);
}
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
UpdateWmProtocols(wmPtr);