.
D 2007-03-08T00:54:44
J icomment Logged\sIn:\sYES\s\nuser_id=1386588\nOriginator:\sNO\n\n\nHere's\sa\sfix.\sIt\ssimply\sdoes\sa\sTcl_DuplicateObj\nof\sthe\sinput\slist\sand\ssorts\sthat\s(but\sonly\sfor\ncalls\susing\s-command\ssince\sthis\sis\sthe\sonly\sway\sto\nhit\sthe\sproblem).\n[PS\stry\sdoing\sthe\sgiven\sexample\susing\s-indices.\nNo\scrash,\sbut\ssome\sodd\slooking\sindexes!]\n\n\n---\stclCmdIL.c-orig2007-03-07\s17:42:32.856819800\s+0000\n+++\stclCmdIL.c2007-03-07\s17:47:05.580806000\s+0000\n@@\s-4143,7\s+4143,7\s@@\n\s\s\s\s\sint\si,\sindex,\sunique,\sindices;\n\s\s\s\s\sTcl_Obj\s*resultPtr;\n\s\s\s\s\sint\slength;\n-\s\s\s\sTcl_Obj\s*cmdPtr,\s**listObjPtrs;\n+\s\s\s\sTcl_Obj\s*cmdPtr,\s*listPtr,\s**listObjPtrs;\n\s\s\s\s\sSortElement\s*elementArray;\n\s\s\s\s\sSortElement\s*elementPtr;\n\s\s\s\s\sSortInfo\ssortInfo;/*\sInformation\sabout\sthis\ssort\sthat\sneeds\sto\n@@\s-4302,9\s+4302,14\s@@\n\s}\n\sTcl_ListObjAppendElement(interp,\snewCommandPtr,\sTcl_NewObj());\n\ssortInfo.compareCmdPtr\s=\snewCommandPtr;\n+/*\sFixes\s[SW#1675116]\s*/\n+listPtr\s=\sTcl_DuplicateObj(objv[objc-1]);\n+Tcl_IncrRefCount(listPtr);\n+\s\s\s\s}\selse\s{\n+listPtr\s=\sobjv[objc-1];\n\s\s\s\s\s}\n\s\n-\s\s\s\ssortInfo.resultCode\s=\sTcl_ListObjGetElements(interp,\sobjv[objc-1],\n+\s\s\s\ssortInfo.resultCode\s=\sTcl_ListObjGetElements(interp,\slistPtr,\n\s\s\s\s\s&length,\s&listObjPtrs);\n\s\s\s\s\sif\s(sortInfo.resultCode\s!=\sTCL_OK\s||\slength\s<=\s0)\s{\n\sgoto\sdone;\n@@\s-4353,6\s+4358,7\s@@\n\s\s\sdone:\n\s\s\s\s\sif\s(sortInfo.sortMode\s==\sSORTMODE_COMMAND)\s{\n\sTcl_DecrRefCount(sortInfo.compareCmdPtr);\n+Tcl_DecrRefCount(listPtr);\n\ssortInfo.compareCmdPtr\s=\sNULL;\n\s\s\s\s\s}\n\s\s\s\s\sif\s(sortInfo.indexc\s>\s1)\s{\n\n
J login afredd
J mimetype text/plain
J username afredd
K 1675116fffffffffffffffffffffffffffffffff
U afredd
Z 647e86f360b7d62f56a6fe87a787c19a