From: Filip Navara Date: Fri, 9 Dec 2005 17:06:02 +0000 (+0000) Subject: Fix a buffer overflow in OutputDebugStringA. Spotted by mbealby@gmail.com. X-Git-Tag: backups/expat-rbuild@40467~1068 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=b596e807a65903c226fd5b6f453e781ab32d2617;ds=inline Fix a buffer overflow in OutputDebugStringA. Spotted by mbealby@gmail.com. svn path=/trunk/; revision=20008 --- 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);