mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:52:56 +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,
|
hEventLog, dwReadFlags, dwRecordOffset, lpBuffer,
|
||||||
nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
||||||
|
|
||||||
|
if(!pnBytesRead || !pnMinNumberOfBytesNeeded)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
|
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
|
||||||
trying to access a null pointer */
|
trying to access a null pointer */
|
||||||
if (!lpBuffer)
|
if (!lpBuffer)
|
||||||
|
@ -737,6 +743,12 @@ ReadEventLogW(IN HANDLE hEventLog,
|
||||||
hEventLog, dwReadFlags, dwRecordOffset, lpBuffer,
|
hEventLog, dwReadFlags, dwRecordOffset, lpBuffer,
|
||||||
nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
|
||||||
|
|
||||||
|
if(!pnBytesRead || !pnMinNumberOfBytesNeeded)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
|
/* If buffer is NULL set nNumberOfBytesToRead to 0 to prevent rpcrt4 from
|
||||||
trying to access a null pointer */
|
trying to access a null pointer */
|
||||||
if (!lpBuffer)
|
if (!lpBuffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue