Menu

#1512 free of uninitialized DString in tkWindow.c

closed-fixed
9
2003-07-16
2003-06-17
No

in generic/tkWindow.c, near line 2938, there is the
following code:

if (Tcl_IsSafe(interp)) {
<snip>
Tcl_DString ds;
<snip>
while (1) {
master = Tcl_GetMaster(master);
if (master == NULL) {
Tcl_DStringFree(&ds);

I believe the call to Tcl_DStringFree is an error. The
variable "ds" does not actually get initialized until later,
near line 2978. Attempting to free this invalid DString
causes a crash in the debug build of the HEAD. This
same bug also exists in the core-8-4-branch.

Discussion

  • Joe Mistachkin

    Joe Mistachkin - 2003-07-16
    • priority: 7 --> 9
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-16
    • status: open --> closed-fixed
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-16

    Logged In: YES
    user_id=72656

    Fixed for 8.4.4 and 8.5a.

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Would it be better to use a Tcl_Obj to accumulate the call
    to ::safe::TkInit?