mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-14 08:30:58 +00:00
osd.c: patch up a possible oob access of osdtext[].
git-svn-id: https://svn.eduke32.com/eduke32@4210 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a4510e35a1
commit
a2d0008e32
1 changed files with 6 additions and 0 deletions
|
@ -1491,6 +1491,12 @@ void OSD_Draw(void)
|
||||||
|
|
||||||
for (; lines>0; lines--, row--)
|
for (; lines>0; lines--, row--)
|
||||||
{
|
{
|
||||||
|
// XXX: May happen, which would ensue an oob if not checked.
|
||||||
|
// Last char accessed is osdtext[topoffs + osdcols-1].
|
||||||
|
// Reproducible by running test.lua with -Lopts=diag
|
||||||
|
// and scrolling to the top.
|
||||||
|
if (topoffs + osdcols-1 >= sizeof(osdtext))
|
||||||
|
break;
|
||||||
drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
|
drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
|
||||||
topoffs+=osdcols;
|
topoffs+=osdcols;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue