<i>valgrind reports uninitialized memory access running the test suite</i> status still Closed with 5 other changes
by
.
D 2026-03-11T15:40:45.307
J closedate 2461111.1533021643
J closer sebres
J icomment <blockquote>>\sIt\shas\snothing\sto\sdo\swith\sallocation\sstrategy.</blockquote>\r\n\r\nI'm\sagree.\sHowever\sit\sis\sindirectly\sabout\sallocation,\ssee\sbelow...\r\n\r\n<blockquote>>\sIt's\sa\scompiler\sexpectation\sthat\s(ScriptLimitCallbackKey\s*)\swill\spoint\sto\sa\slocation\swith\ssizeof(ScriptLimitCallbackKey)\svalid\sbytes</blockquote>\r\n\r\nNope.\sThe\scompiler\sexpectation\shere\sis\sto\sallocate,\scompare,\shash,\swhatever\saction\swith\san\sarray\sof\sint's,\sand\salthough\sit\sallows\sso\sto\shandle\sstructures\sin\sa\shash-table,\sit\sdoesn't\sdo\sthat\susing\sstructures\sinternally,\sbecause\sthe\shash-table\sAPI\sconsiders\sblocks\sof\sint's,\snothing\selse.\r\n\r\nSo\sif\syou\swant\sto\sestimate\sthe\simpact\sof\sthe\schange\sof\sJan,\syou\sshall\srather\sconsider\sit\sas\sarray\sof\sints\severywhere.\sBut!..\r\n\r\nThe\sfix\sof\sJan\smay\sindeed\sintroduce\sa\sproblem\sindirectly,\ssince\sAllocArrayEntry\scould\sallocate\sa\sblock\sfor\shash-entry\s+\s3\sintegers\s(12\sbytes),\sit\scan\sindeed\scause\smany\sissues\sat\scorner\scase\s(e.\sg.\sckalloc\sreturns\slast\sblock\smatching\sthe\srange\sof\sbuffer).\sAnd\sin\sbest\scase\san\sUB,\ssince\scasting\sa\sstruct\sthat\srequires\s16\sbytes\s(due\sto\s4\sbytes\sof\strailing\spadding)\sto\sa\smemory\sblock\sof\sonly\s12\sbytes\smay\slead\sto\sUB\sby\san\sattempt\sto\saccess\sthe\sstruct\sas\sa\swhole\sor\sto\suse\sit\sin\scertain\soperations.<br/>\r\nOf\scourse\sit\sdepends,\sbut\sin\sworse\scase\sit\scan\sbe\seven\sout-of-bounds\smemory\saccess\s(with\sSF\sor\sdata\scorruption),\sBO\son\swrite\s(in\sassumed\sas\spadding\smemory),\sbroken\sarray\spointer\sarithmetic\setc.\r\n\r\nSo\sI\sam\swith\sAshok\shere\sand\sit\sshall\sbe\srewritten\s(at\sleast\sfor\s64-bit\starget).
J login sebres
J mimetype text/x-fossil-wiki
K f7495f63c01ea80069198ac183e1e0cc8873dabe
U sebres
Z 42dac35b59a4fa57e24cab7563ff1d3b