From f95ec0e894eb045b9d02cb782508059e8509ea65 Mon Sep 17 00:00:00 2001 From: jenglish Date: Mon, 24 Jan 2011 19:50:59 +0000 Subject: tkSelect.c: Fix for [Bug #3164879] (memory allocation bug introduced by [Patch #3129527]) --- ChangeLog | 5 +++++ generic/tkSelect.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60ef9ca..8448897 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-24 Joe English + + * generic/tkSelect.c: Fix for [Bug #3164879] + (memory allocation bug introduced by [Patch #3129527]) + 2011-01-22 Joe English * generic/ttk/ttkEntry.c(ttk::combobox): Add missing 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); -- cgit v0.12