Tk Source Code

View Ticket
Login
Ticket UUID: 689357
Title: Read of Freed Memory
Type: Bug Version: obsolete: 8.4.1
Submitter: dkf Created on: 2003-02-19 16:12:41
Subsystem: 46. Unix Fonts Assigned To: hobbs
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2003-02-20 04:48:59
Resolution: Duplicate Closed By: dkf
    Closed on: 2003-02-19 21:48:59
Description:
Tk_MeasureChars() and Tk_DrawChars() (in
unix/tkUnixFont.c) are both capable of ending up
reading freed memory (which is a critical failure when
Tcl is built with memory debugging turned on) the
*second* time the subfont table for a font is extended.

The problem is that those two functions keep around a
pointer into the old subfont table over a call to
FindSubFontForChar() which (via its calls to
CanUseAlias()) can reallocate the subfont table.  The
first reallocation is harmless enough, because we start
out with a subfont table that is allocated as part of
the overall font structure, but the second leaves us
dangling off into nowhere...
User Comments: hobbs added on 2003-02-20 03:00:26:
Logged In: YES 
user_id=72656

Is this a dup of 618872?  If some can look into a solution, that 
would be great.