summaryrefslogtreecommitdiffstats
path: root/generic/tkSelect.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2011-01-24 19:50:59 (GMT)
committerjenglish <jenglish@flightlab.com>2011-01-24 19:50:59 (GMT)
commitf95ec0e894eb045b9d02cb782508059e8509ea65 (patch)
tree33e835ea3be4d67856dfa35e951c35bc998cebbe /generic/tkSelect.c
parent65664f23690aae1f0085eaf6a6315b3f4b70b5b5 (diff)
downloadtk-f95ec0e894eb045b9d02cb782508059e8509ea65.zip
tk-f95ec0e894eb045b9d02cb782508059e8509ea65.tar.gz
tk-f95ec0e894eb045b9d02cb782508059e8509ea65.tar.bz2
tkSelect.c: Fix for [Bug #3164879] (memory allocation bug
introduced by [Patch #3129527])
Diffstat (limited to 'generic/tkSelect.c')
-rw-r--r--generic/tkSelect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 6077754..34fd29b 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.33 2010/12/06 10:30:49 nijtmans Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.34 2011/01/24 19:51:00 jenglish Exp $
*/
#include "tkInt.h"
@@ -192,8 +192,8 @@ Tk_CreateSelHandler(
* should make a copy for this selPtr.
*/
- unsigned cmdInfoLen = sizeof(CommandInfo) +
- ((CommandInfo *) clientData)->cmdLength - 3;
+ unsigned cmdInfoLen = Tk_Offset(CommandInfo, command) +
+ ((CommandInfo *)clientData)->cmdLength + 1;
selPtr->clientData = ckalloc(cmdInfoLen);
memcpy(selPtr->clientData, clientData, cmdInfoLen);