Skip to content
Tcl Source Code Artifact [dbf1a38a7a]
Login

Artifact [dbf1a38a7a]

Artifact dbf1a38a7aeae323320d3d92e2d66e7fde53067d:

Ticket change [dbf1a38a7a] - New ticket [217898ffffffffff|217898ffff] <i>tclScan.c should not blindly call ckalloc() for zero bytes o</i>. by nobody on 2000-10-26 00:45:35.
D 2000-10-26T00:45:35
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s2518\sBug\nVersion:\s8.2b2\nSubmitDate:\s'1999-08-10'\nLastModified:\s'1999-09-17'\nSeverity:\sMED\nStatus:\sClosed\nSubmitter:\stechsupp\nChangedBy:\shobbs\nRelatedBugIDs:\s2795\nOS:\sAIX\nOSVersion:\s4.3.2\nMachine:\sRS6000\nFixedDate:\s'2000-10-25'\nClosedDate:\s'1999-09-17'\n\n\nName:\nValdis\sKletnieks\n\nCVS:\nupdated\sfrom\sCVS\s08/10/99\s*\sRCS:\s@(#)\s$Id:\stclScan.c,v\s1.2\s1999/04/16\s00:46:53\sstanton\sExp\s$\n\nComments:\nThe\sattached\spatch\sworks\saround\sthe\sproblem\sat\sthe\scost\sof\sa\ssmall\n\s\s\s\samount\n\s\s\s\sof\stemporarily\sallocated\smemory.\s\sI\swasn't\sambitious\senough\sto\sexamine\n\s\s\s\stclScan.c\n\s\s\s\sin\smore\sdetail\sto\ssee\sif\sthere\sshould\sbe\sexplicit\stests/returns\sif\n\s\s\s\snumVars\n\s\s\s\swas\sa\sbroken\svalue.\n\nReproducibleScript:\nOn\sAIX\s4.3.2,\s'make\stest'\sfails\sfatally\sin\s'scan.test'\swith\san\serror\n\s\s\s\sunable\sto\sallocate\szero\sbytes.\n\nDesiredBehavior:\ntclScan.c\sshould\snot\sblindly\scall\sckalloc()\sfor\szero\sbytes,\swhich\scan\n\s\s\s\shappen\n\s\s\s\sif\sValidateFormat()\sor\sTcl_ScanObjCmd()\sis\scalled\swith\san\sincorrect\sobjv\n\s\s\s\slist\n\s\s\s\s(which\sis\sintentionally\stested\sin\sscan.test,\sand\scould\salso\sbe\stripped\n\s\s\s\sover\n\s\s\s\sby\sbuggy\suser\scode,\swhich\sshould\strigger\sa\stcl_error,\snot\scrash\sTcl\n\s\s\s\sentirely.\n\nPatch:\nhttp://black-ice.cc.vt.edu/~valdis/tcl8.2.tclScan.patch\n\nPatchFiles:\ntclScan.c\n\n\n\nThis\sappears\sto\sbe\sjust\san\sAIX\sproblem.\s\sDuffin\ssays\sthat\sthe\nalloc\sof\s0\sbytes\sis\sundefined\s(although\sit\sshouldn't\scrash).\nHe\salso\sstates:\n\nLooking\sat\sthe\scode\sin\sValidateFormat\sin\stclScan.c\sI\snoticed\sthat\syou\nare\snot\strying\sto\suse\sa\slocal\sfixed\ssize\sarray\sas\sis\snormally\sdone\sto\ntry\sand\sreduce\sthe\snumber\sof\sallocations\sso\sthat\sis\sprobably\sthe\nproblem.\sDoing\ssomething\slike\n\nif\s(numVars\s>\sLOCAL_SIZE)\s{\nnassign\s=\sckalloc\s(...)\n}\selse\s{\nnassign\s=\slocalArray;\n}\n\nand\sthe\snecessary\sclean\sup\swill\sprobably\sfix\sit\sand\sfit\sin\sbetter\swith\nthe\sway\sthat\sit\sis\snormally\sdone.\n\s\n--\s08/11/1999\shobbs
J foundin obsolete:\s8.2b2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title tclScan.c\sshould\snot\sblindly\scall\sckalloc()\sfor\szero\sbytes\so
J type Bug
K 217898ffffffffffffffffffffffffffffffffff
U nobody
Z 74bd6dcb2881823e8447711488a8f179