diff options
author | nijtmans <nijtmans> | 2011-01-25 08:49:59 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2011-01-25 08:49:59 (GMT) |
commit | d9f56d2b769b4cfce39f195178c30a407de8cccb (patch) | |
tree | 05ebd64c7a56b5c6c3ba5b75b9e88c284d137a77 /unix | |
parent | 31f8fbbd1d658b3474895271c7c3525112097d7e (diff) | |
download | tk-d9f56d2b769b4cfce39f195178c30a407de8cccb.zip tk-d9f56d2b769b4cfce39f195178c30a407de8cccb.tar.gz tk-d9f56d2b769b4cfce39f195178c30a407de8cccb.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/.cvsignore | 8 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/unix/.cvsignore b/unix/.cvsignore new file mode 100644 index 0000000..96bf441 --- /dev/null +++ b/unix/.cvsignore @@ -0,0 +1,8 @@ +*.so +*.a +Makefile +tkConfig.sh +tktest +wish +config.cache +config.status diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 234b23f..f23cba4 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.36.2.8 2010/01/23 01:36:03 patthoyts Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.36.2.9 2011/01/25 08:49:59 nijtmans Exp $ */ #include "tkPort.h" @@ -2708,7 +2708,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); } if (!(wmPtr->flags & WM_NEVER_MAPPED)) { UpdateWmProtocols(wmPtr); |