diff options
author | nijtmans <nijtmans> | 2011-01-25 08:31:37 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2011-01-25 08:31:37 (GMT) |
commit | 5b84ecf332d72a17a8d8c7b82998c10bd0690cdb (patch) | |
tree | 5102c8db204c464ad05ae31f1603514f24068789 /generic/tkSelect.c | |
parent | f337508e17cbc21d9d2d6ca9b8f22b21766a138f (diff) | |
download | tk-5b84ecf332d72a17a8d8c7b82998c10bd0690cdb.zip tk-5b84ecf332d72a17a8d8c7b82998c10bd0690cdb.tar.gz tk-5b84ecf332d72a17a8d8c7b82998c10bd0690cdb.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 'generic/tkSelect.c')
-rw-r--r-- | generic/tkSelect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c index dca3d1c..b1551f0 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.20 2007/04/17 14:36:49 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.20.4.1 2011/01/25 08:31:37 nijtmans Exp $ */ #include "tkInt.h" @@ -909,7 +909,7 @@ Tk_SelectionObjCmd( cmdInfoPtr->byteOffset = 0; cmdInfoPtr->buffer[0] = '\0'; cmdInfoPtr->cmdLength = cmdLength; - strcpy(cmdInfoPtr->command, string); + memcpy(cmdInfoPtr->command, string, cmdLength + 1); Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand, (ClientData) cmdInfoPtr, format); } |