Skip to content
Tcl Source Code Artifact [804aa0b9a5]
Login

Artifact [804aa0b9a5]

Artifact 804aa0b9a5230f9e6deabb1864b39c1c7ec62037:

Ticket change [804aa0b9a5] - New ticket [473875ffffffffff|473875ffff] <i>nextPtr init in Tk_GetCursorFromData()</i>. by nobody on 2001-10-23 02:20:25.
D 2001-10-23T02:20:25
J assignee nobody
J cmimetype text/plain
J comment Tk_GetCursorFromData()\sdoes\snot\sinitialize\snextPtr\nfield\sto\sNULL\swhen\sallocating\sa\snew\sTk_Cursor\sobject.\nIf\sthe\sallocated\smemory\sis\snot\sautomatically\s\ninitialized,\sit'll\scause\sa\sproblem\slater\swhen\s\nanother\scursor\sis\sallocated\sfrom\sthe\ssame\sdata\nafter\sthis\scursor\sis\sdestroyed.\sI.e.:\n\na\s=\sTk_GetCursorFromData(...);\n...\nTk_FreeCursor(a);\n...\n/*\sb\sis\sallocated\susing\sthe\ssame\ssetup\sas\sa\s*/\nb\s=\sTk_GetCursorFromData(...);\s/*\sseg\sfault\s*/\n\nThis\swas\sfound\swith\shiertable\sin\sblt2.4u.\n\nSolution:\sapply\sthe\sfollowing\spatch\sto\sgeneric/tkCursor.c:\n\n---\stkCursor.c.oldMon\sOct\s22\s19:16:41\s2001\n+++\stkCursor.cMon\sOct\s22\s18:57:37\s2001\n@@\s-384,6\s+384,8\s@@\n\s\s\s\s\scursorPtr->objRefCount\s=\s0;\n\s\s\s\s\scursorPtr->idHashPtr\s=\sTcl_CreateHashEntry(&dispPtr->cursorIdTable,\s\n\s\s\s\s\s\s\s\s\s\s\s\s\s(char\s*)\scursorPtr->cursor,\s&new);\n+\s\s\s\s/*\sXXX\sSet\snextPtr\sto\sNULL\s!\s*/\n+\s\s\s\scursorPtr->nextPtr\s=\sNULL;\n\s\n\s\s\s\s\sif\s(!new)\s{\n\spanic("cursor\salready\sregistered\sin\sTk_GetCursorFromData");\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem None
J title nextPtr\sinit\sin\sTk_GetCursorFromData()
J type Patch
K 473875ffffffffffffffffffffffffffffffffff
U nobody
Z 82276706b7d4a3af794c60ea2be07fa1