mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
Add parameters check to ReadEventLog.
Fixes last advapi32:eventlog crash svn path=/trunk/; revision=45125
This commit is contained in:
@@ -673,6 +673,12 @@ ReadEventLogA(IN HANDLE hEventLog,
|
||||
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 */
|
||||
if (!lpBuffer)
|
||||
@@ -737,6 +743,12 @@ ReadEventLogW(IN HANDLE hEventLog,
|
||||
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 */
|
||||
if (!lpBuffer)
|
||||
|
||||
Reference in New Issue
Block a user