From b596e807a65903c226fd5b6f453e781ab32d2617 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 9 Dec 2005 17:06:02 +0000 Subject: [PATCH] Fix a buffer overflow in OutputDebugStringA. Spotted by mbealby@gmail.com. svn path=/trunk/; revision=20008 --- reactos/lib/kernel32/debug/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/kernel32/debug/output.c b/reactos/lib/kernel32/debug/output.c index abe7cb6e008..0a06a845318 100644 --- a/reactos/lib/kernel32/debug/output.c +++ b/reactos/lib/kernel32/debug/output.c @@ -397,10 +397,10 @@ VOID WINAPI OutputDebugStringA(LPCSTR _OutputString) nRoundLen = nOutputStringLen; /* copy the current block into the buffer */ - memcpy(pDBMonBuffer->Buffer, _OutputString, nOutputStringLen); + memcpy(pDBMonBuffer->Buffer, _OutputString, nRoundLen); /* null-terminate the current block */ - pDBMonBuffer->Buffer[nOutputStringLen] = 0; + pDBMonBuffer->Buffer[nRoundLen] = 0; /* signal that the data contains meaningful data and can be read */ SetEvent(hDBMonDataReady); -- 2.17.1