: <i>A stack overflow vulnerability in Tcl nmakehelp.c allows code execution via a crated file</i> plus 8 other changes
by
.
D 2021-06-22T09:17:26.018
J assignee jan.nijtmans
J closedate 2459387.88710669
J closer jan.nijtmans
J icomment Well,\slet's\sanalyse\sit.\r\n\r\nSince\sszBuffer\sis\sinitialized\swith\sfgets(),\sit\sis\sguaranteed\sto\sbe\sa\sNULL-terminated\sstring.\sThe\stwo\slater\swhile's\scheck\sfor\s"*p"\sand\s"*q"\sresp,\sso\sthose\stwo\swhile-loops\send\s-\sworst-case\s-\sat\sthe\sfinal\sNULL-character.\sIf\s'p'\spoints\sat\sszBuffer[0]\sand\s'q'\spoints\sat\sszBuffer[99],\sthen\s-\sstill\s-\sthe\smemcpy()\sdoes\snot\soverflow.\sI\sdon't\ssee\sat\sall\show\sthis\scan\slead\sto\scode\sexecution.\r\n\r\nIf\syou\sfound\sthis\sby\ssome\sautomatic\stool,\sthen\splease\sreport\sthis\sas\s"false\salarm"\sto\sthe\stool\smaintainers.\r\n\r\nThe\sonly\sbug\sI\ssee\sin\sthis\sline\sis\sthat\s'memcpy()'\sshould\shave\sbeen\sa\s'memmove()',\ssince\sp\sis\spointing\sto\sthe\ssame\sbuffer,\sit\scould\sbe\soverlapping,\swhich\sis\sdisallowed\sfor\s'memcpy()'.\sThat's\sfixed\shere:\s[28ef6c0c741408a2]\s(but\s-\sstill\s-\sthat\scannot\slead\sto\scode\sexecution.
J login jan.nijtmans
J mimetype text/x-fossil-wiki
J resolution Invalid
J severity Cosmetic
J status Closed
K 7079e4f91601e9c784e151e86c9d7821afdd45fe
U jan.nijtmans
Z 852ebda66e614110e1e0a062482de743