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

commit e8df1a38bd09e0416a1de7006615abfd1c845c9c
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Mon Mar 2 00:56:33 2020 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Mon Mar 2 01:08:41 2020 +0100

    [CONSRV] Fix a corruption of the CONSRV memory when converting read input 
events back to ANSI.
    
    This fixes a 6-year old copy-paste bug introduced by commit b47d51c6 
(r64004).
---
 win32ss/user/winsrv/consrv/coninput.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/win32ss/user/winsrv/consrv/coninput.c 
b/win32ss/user/winsrv/consrv/coninput.c
index 8c2e0e82adb..b4b3061e1a3 100644
--- a/win32ss/user/winsrv/consrv/coninput.c
+++ b/win32ss/user/winsrv/consrv/coninput.c
@@ -564,9 +564,10 @@ ReadInputBuffer(IN PGET_INPUT_INFO InputInfo,
             /* Now translate everything to ANSI */
             if (!GetInputRequest->Unicode)
             {
-                for (; NumEventsRead > 0; --NumEventsRead)
+                ULONG i;
+                for (i = 0; i < NumEventsRead; ++i)
                 {
-                    ConioInputEventToAnsi(InputBuffer->Header.Console, 
--InputRecord);
+                    ConioInputEventToAnsi(InputBuffer->Header.Console, 
&InputRecord[i]);
                 }
             }
         }

Reply via email to