Commit e6bffc09 authored by Ian Schmidt's avatar Ian Schmidt Committed by Alexandre Julliard

Added pointer validation and additional sanity check to IsValidSid().

parent b49b4117
......@@ -202,6 +202,15 @@ CopySid( DWORD nDestinationSidLength, PSID pDestinationSid, PSID pSourceSid )
BOOL WINAPI
IsValidSid( PSID pSid )
{
if (IsBadReadPtr(pSid, 4))
{
WARN_(security)("(%p): invalid pointer!", pSid);
return FALSE;
}
if (pSid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES)
return FALSE;
if (!pSid || pSid->Revision != SID_REVISION)
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment