summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjenglish <jenglish@noemail.net>2003-01-14 19:23:55 (GMT)
committerjenglish <jenglish@noemail.net>2003-01-14 19:23:55 (GMT)
commitfbd7e71c963f50a7d378158c8d5a129f457dd3eb (patch)
tree5785c6425b51ccf9e86588eaabdb2c5c93cadbed /generic
parentbd03899c03e92fe5485edf06c8ee19d17bf877e0 (diff)
downloadtk-fbd7e71c963f50a7d378158c8d5a129f457dd3eb.zip
tk-fbd7e71c963f50a7d378158c8d5a129f457dd3eb.tar.gz
tk-fbd7e71c963f50a7d378158c8d5a129f457dd3eb.tar.bz2
* generic/tkSelect.c (Tk_CreateSelHandler):
Fix for #666346 "Selection handling crashes under KDE 3.0" * tests/unixSelect.test (unixSelect-1.20): Added test case. FossilOrigin-Name: d6fd320a3fbd5ed8fcdfeb9ed2b6da8ebdf5f859
Diffstat (limited to 'generic')
-rw-r--r--generic/tkSelect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index af98ccd..d62aa43 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -11,7 +11,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.12 2002/08/31 06:12:26 das Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.13 2003/01/14 19:24:56 jenglish Exp $
*/
#include "tkInt.h"
@@ -200,9 +200,10 @@ Tk_CreateSelHandler(tkwin, selection, target, proc, clientData, format)
* The clientData is selection controlled memory, so
* we should make a copy for this selPtr.
*/
- selPtr->clientData =
- (ClientData) ckalloc(sizeof(clientData));
- memcpy(selPtr->clientData, clientData, sizeof(clientData));
+ unsigned cmdInfoLen = sizeof(CommandInfo) +
+ ((CommandInfo*)clientData)->cmdLength - 3;
+ selPtr->clientData = (ClientData)ckalloc(cmdInfoLen);
+ memcpy(selPtr->clientData, clientData, cmdInfoLen);
} else {
selPtr->clientData = clientData;
}