mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 17:01:53 +00:00
Add parameters check to ReadEventLog.
Fixes last advapi32:eventlog crash svn path=/trunk/; revision=45125
This commit is contained in:
parent
734debd8dc
commit
20e9adf489
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue