From f8faa0b660da189ce00c614e19aa0a47a05d2520 Mon Sep 17 00:00:00 2001 From: Valerij Zaporogeci Date: Tue, 25 Jan 2022 16:49:46 +0200 Subject: [PATCH] [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. --- base/applications/taskmgr/graphctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/taskmgr/graphctl.c b/base/applications/taskmgr/graphctl.c index 0d15f4d61d8..4253eeadc35 100644 --- a/base/applications/taskmgr/graphctl.c +++ b/base/applications/taskmgr/graphctl.c @@ -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++; }