From 3ceb8b3a748eb425d00c78457e708542c57e488d Mon Sep 17 00:00:00 2001 From: hobbs Date: Mon, 7 Apr 2008 23:12:04 +0000 Subject: * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv * tests/main.test (main-3.*): error. [Bug 1937135] --- ChangeLog | 7 ++++++- changes | 4 +++- generic/tkWindow.c | 3 +-- tests/main.test | 39 +++++++++++++++++++++++++-------------- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 871df4c..a471732 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ -2008-04-07 Don Porter +2008-04-07 Jeff Hobbs *** 8.4.19 TAGGED FOR RELEASE *** + * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv + * tests/main.test (main-3.*): error. [Bug 1937135] + +2008-04-07 Don Porter + * README: Bump version number to 8.4.19 * generic/tk.h: * unix/configure.in: diff --git a/changes b/changes index 24f46ce..691ebea 100644 --- a/changes +++ b/changes @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.64.2.53 2008/04/07 19:17:54 dgp Exp $ +RCS: @(#) $Id: changes,v 1.64.2.54 2008/04/07 23:12:06 hobbs Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6159,4 +6159,6 @@ use (hobbs) 2008-03-27 (platform support)[1921166] Solaris 64bit build fixes (steffen) +2008-04-07 (bug fix)[1937135] Fix double-free with argv error (hobbs) + --- Released 8.4.19, April 11, 2008 --- See ChangeLog for details --- diff --git a/generic/tkWindow.c b/generic/tkWindow.c index eb21177..4be22b9 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.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: tkWindow.c,v 1.56.2.14 2006/09/25 17:28:20 andreas_kupries Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.56.2.15 2008/04/07 23:12:10 hobbs Exp $ */ #include "tkPort.h" @@ -3067,7 +3067,6 @@ Initialize(interp) if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv, argTable, TK_ARGV_DONT_SKIP_FIRST_ARG|TK_ARGV_NO_DEFAULTS) != TCL_OK) { - ckfree((char *) argv); goto argError; } p = Tcl_Merge(argc, argv); diff --git a/tests/main.test b/tests/main.test index 0f25637..fd65073 100644 --- a/tests/main.test +++ b/tests/main.test @@ -8,7 +8,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: main.test,v 1.6 2002/07/13 20:28:35 dgp Exp $ +# RCS: @(#) $Id: main.test,v 1.6.2.1 2008/04/07 23:12:10 hobbs Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -34,19 +34,30 @@ test main-1.1 {StdinProc} {unix} { list $error $msg } {0 {}} +test main-3.1 {Tk_ParseArgv: -help option} -constraints unix -body { + # Run only on unix as Win32 pops up native dialog + list [catch {exec [interpreter] -help} msg] $msg +} -match glob -result {1 {% Application initialization failed: Command-specific options:*}} + +test main-3.2 {Tk_ParseArgv: -help option} -setup { + set maininterp [interp create] +} -body { + $maininterp eval { set argc 1 ; set argv -help } + list [catch {load {} Tk $maininterp} msg] $msg +} -cleanup { + interp delete $maininterp +} -match glob -result {1 {Command-specific options:*}} + +test main-3.3 {Tk_ParseArgv: -help option} -setup { + set maininterp [interp create] +} -body { + # Repeat of 3.2 to catch cleanup, eg Bug 1927135 + $maininterp eval { set argc 1 ; set argv -help } + list [catch {load {} Tk $maininterp} msg] $msg +} -cleanup { + interp delete $maininterp +} -match glob -result {1 {Command-specific options:*}} + # cleanup ::tcltest::cleanupTests return - - - - - - - - - - - - - -- cgit v0.12