Author: spetreolle Date: Sun Jan 17 22:40:39 2010 New Revision: 45125
URL: http://svn.reactos.org/svn/reactos?rev=45125&view=rev Log: Add parameters check to ReadEventLog. Fixes last advapi32:eventlog crash
Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c
Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service/... ============================================================================== --- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Sun Jan 17 22:40:39 2010 @@ -672,6 +672,12 @@ TRACE("%p, %lu, %lu, %p, %lu, %p, %p\n", hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded); + + if(!pnBytesRead || !pnMinNumberOfBytesNeeded) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + }
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from trying to access a null pointer */ @@ -736,6 +742,12 @@ TRACE("%p, %lu, %lu, %p, %lu, %p, %p\n", hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded); + + if(!pnBytesRead || !pnMinNumberOfBytesNeeded) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + }
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from trying to access a null pointer */