summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authornijtmans <nijtmans>2011-01-25 08:31:37 (GMT)
committernijtmans <nijtmans>2011-01-25 08:31:37 (GMT)
commite879651f606df661d88f8b3ae73bdbbd37d4082c (patch)
tree5102c8db204c464ad05ae31f1603514f24068789 /unix
parenta997d84bbfd5ab7b01bebf18efbc60b358770bc0 (diff)
downloadtk-e879651f606df661d88f8b3ae73bdbbd37d4082c.zip
tk-e879651f606df661d88f8b3ae73bdbbd37d4082c.tar.gz
tk-e879651f606df661d88f8b3ae73bdbbd37d4082c.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 'unix')
-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);