https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8faa0b660da189ce00c614e19aa0a47a05d2520

commit f8faa0b660da189ce00c614e19aa0a47a05d2520
Author:     Valerij Zaporogeci <[email protected]>
AuthorDate: Tue Jan 25 16:49:46 2022 +0200
Commit:     GitHub <[email protected]>
CommitDate: Tue Jan 25 15:49:46 2022 +0100

    [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++;
     }

Reply via email to