[TASKMGR] Fix a heap corruption bug (#4311)

Improper adjustment of the array index in graphctl.c, introduced in PR #4141 lead to an off-by-one heap corruption.
This commit is contained in:
Valerij Zaporogeci 2022-01-25 16:49:46 +02:00 committed by GitHub
parent 5972c0c18b
commit f8faa0b660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,7 +150,7 @@ GraphCtrl_AddPoint(PTM_GRAPH_CONTROL inst, BYTE val0, BYTE val1)
t = inst->PointBuffer;
Prev0 = *(t + inst->CurrIndex);
Prev1 = *(t + inst->CurrIndex + inst->NumberOfPoints);
if (inst->CurrIndex < inst->NumberOfPoints)
if (inst->CurrIndex < inst->NumberOfPoints - 1)
{
inst->CurrIndex++;
}