.
D 2004-06-09T04:01:15
J assignee hobbs
J cmimetype text/plain
J comment After\ssetting\sthe\s-maxundo\soption\sin\sthe\stext\swidget,\sa\s\nmemory\sviolation\shappens\swhen\snumber\sof\sundo\s\noperations\sexceeds\sthis\smaximum\sbound.\n\nUsing\stcl\s8.4.6\swith\smemory\sdebugging\son,\sdo\sthis:\n\ntext\s.t\s-undo\s1\s-autoseparator\s1\s-maxundo\s2\npack\s.t\s-expand\s1\s-fill\sboth\n.t\sinsert\send\s<some\sblock\sof\stext>\n\n1.\sselect\sa\sportion\sof\sthe\stext\sand\sdo\s"Control-X"\n2.\sdo\s"Control-V"\sto\spaste\sback.\n3.\sselect\sanother\sblock\sof\stext\san\sdo\s"Control-X",\sthe\s\nprogram\scrashes.\n\nThe\sbug\sis\sin\stkUndo.c,\sline\s205.\s\sThe\sloop\sto\sfree\sundo\s\nelement\sis\sincorrect.\s\sPatch\sto\sfix\sis\sthis:\n\nIndex:\sgeneric/tkUndo.c\n==========================================\n=========================\nRCS\s\nfile:\s/home/cvs/starvine/cvsroot/tk/generic/tkUndo.c,v\nretrieving\srevision\s1.3\ndiff\s-u\s-r1.3\stkUndo.c\n---\sgeneric/tkUndo.c\s\s\s\s9\sMar\s2004\s08:23:25\s-0000\s\s\s\s\s\s\s\n1.3\n+++\sgeneric/tkUndo.c\s\s\s\s9\sJun\s2004\s03:52:01\s-0000\n@@\s-205,7\s+205,7\s@@\n\s\s\s\s\s\s\s\s\swhile\s(\selem\s)\s{\n\s\s\s\s\s\s\s\s\s\s\s\sprevelem\s=\selem;\n\s\s\s\s\s\s\s\s\s\s\s\selem\s=\selem->next;\n-\s\s\s\s\s\s\s\s\s\s\sckfree((char\s*)\selem);\n+\s\s\s\s\s\s\s\s\s\s\sckfree((char\s*)\sprevelem);\n\s\s\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\s\sstack->depth\s=\sstack->maxdepth;\n\s\s\s\s\s}\n
J foundin obsolete:\s8.4.6
J priority 5\sMedium
J resolution None
J status Open
J submitter jiangwu
J subsystem 41.\sMemory\sAllocation
J title Using\s-maxundo\scauses\ssegfault\sin\sText\swidget
J type Bug
K 969358ffffffffffffffffffffffffffffffffff
U jiangwu
Z 2e29e5b746cdc65571c132aa2a13424f