mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:21:50 +00:00
[NTOSKRNL]
- Fix returning uninitialized status (CID 15086) svn path=/trunk/; revision=55130
This commit is contained in:
parent
52654ceb2e
commit
2d3c112a48
1 changed files with 23 additions and 44 deletions
|
@ -266,7 +266,6 @@ SepCaptureSid(IN PSID InputSid,
|
|||
{
|
||||
ULONG SidSize = 0;
|
||||
PISID NewSid, Sid = (PISID)InputSid;
|
||||
NTSTATUS Status;
|
||||
|
||||
PAGED_CODE();
|
||||
|
||||
|
@ -274,14 +273,9 @@ SepCaptureSid(IN PSID InputSid,
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForRead(Sid,
|
||||
FIELD_OFFSET(SID,
|
||||
SubAuthority),
|
||||
sizeof(UCHAR));
|
||||
ProbeForRead(Sid, FIELD_OFFSET(SID, SubAuthority), sizeof(UCHAR));
|
||||
SidSize = RtlLengthRequiredSid(Sid->SubAuthorityCount);
|
||||
ProbeForRead(Sid,
|
||||
SidSize,
|
||||
sizeof(UCHAR));
|
||||
ProbeForRead(Sid, SidSize, sizeof(UCHAR));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -291,58 +285,43 @@ SepCaptureSid(IN PSID InputSid,
|
|||
_SEH2_END;
|
||||
|
||||
/* allocate a SID and copy it */
|
||||
NewSid = ExAllocatePool(PoolType,
|
||||
SidSize);
|
||||
if (NewSid != NULL)
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
RtlCopyMemory(NewSid,
|
||||
Sid,
|
||||
SidSize);
|
||||
NewSid = ExAllocatePool(PoolType, SidSize);
|
||||
if (!NewSid)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
*CapturedSid = NewSid;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Free the SID and return the exception code */
|
||||
ExFreePoolWithTag(NewSid, TAG_SID);
|
||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
else
|
||||
_SEH2_TRY
|
||||
{
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
RtlCopyMemory(NewSid, Sid, SidSize);
|
||||
|
||||
*CapturedSid = NewSid;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Free the SID and return the exception code */
|
||||
ExFreePoolWithTag(NewSid, TAG_SID);
|
||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
else if (!CaptureIfKernel)
|
||||
{
|
||||
*CapturedSid = InputSid;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
SidSize = RtlLengthRequiredSid(Sid->SubAuthorityCount);
|
||||
|
||||
/* allocate a SID and copy it */
|
||||
NewSid = ExAllocatePool(PoolType,
|
||||
SidSize);
|
||||
if (NewSid != NULL)
|
||||
{
|
||||
RtlCopyMemory(NewSid,
|
||||
Sid,
|
||||
SidSize);
|
||||
NewSid = ExAllocatePool(PoolType, SidSize);
|
||||
if (NewSid == NULL)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
*CapturedSid = NewSid;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
RtlCopyMemory(NewSid, Sid, SidSize);
|
||||
|
||||
*CapturedSid = NewSid;
|
||||
}
|
||||
|
||||
return Status;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue