mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[NTOSKRNL] In IopQueryNameInternal(), enclose output copy in a SEH statement
This commit is contained in:
parent
15b9a6aa4c
commit
d8f22735ed
1 changed files with 128 additions and 123 deletions
|
@ -1975,6 +1975,8 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||||
/* Get buffer pointer */
|
/* Get buffer pointer */
|
||||||
p = (PWCHAR)(ObjectNameInfo + 1);
|
p = (PWCHAR)(ObjectNameInfo + 1);
|
||||||
|
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
/* Copy the information */
|
/* Copy the information */
|
||||||
if (QueryDosName && NoObCall)
|
if (QueryDosName && NoObCall)
|
||||||
{
|
{
|
||||||
|
@ -2049,8 +2051,7 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||||
if (Status != STATUS_INVALID_PARAMETER && Status != STATUS_INVALID_DEVICE_REQUEST &&
|
if (Status != STATUS_INVALID_PARAMETER && Status != STATUS_INVALID_DEVICE_REQUEST &&
|
||||||
Status != STATUS_NOT_IMPLEMENTED && Status != STATUS_INVALID_INFO_CLASS)
|
Status != STATUS_NOT_IMPLEMENTED && Status != STATUS_INVALID_INFO_CLASS)
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
_SEH2_LEAVE;
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In such case, zero output */
|
/* In such case, zero output */
|
||||||
|
@ -2074,8 +2075,8 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||||
*ReturnLength += LocalFileInfo->FileNameLength;
|
*ReturnLength += LocalFileInfo->FileNameLength;
|
||||||
|
|
||||||
/* Free the allocated buffer and return failure */
|
/* Free the allocated buffer and return failure */
|
||||||
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
Status = STATUS_BUFFER_OVERFLOW;
|
||||||
return STATUS_BUFFER_OVERFLOW;
|
_SEH2_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now calculate the new lengths left */
|
/* Now calculate the new lengths left */
|
||||||
|
@ -2089,8 +2090,8 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||||
if (LocalFileInfo->FileName[0] != OBJ_NAME_PATH_SEPARATOR)
|
if (LocalFileInfo->FileName[0] != OBJ_NAME_PATH_SEPARATOR)
|
||||||
{
|
{
|
||||||
/* Free the allocated buffer and return failure */
|
/* Free the allocated buffer and return failure */
|
||||||
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
Status = STATUS_OBJECT_PATH_INVALID;
|
||||||
return STATUS_OBJECT_PATH_INVALID;
|
_SEH2_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the Name and null-terminate it */
|
/* Write the Name and null-terminate it */
|
||||||
|
@ -2108,9 +2109,13 @@ IopQueryNameInternal(IN PVOID ObjectBody,
|
||||||
sizeof(OBJECT_NAME_INFORMATION);
|
sizeof(OBJECT_NAME_INFORMATION);
|
||||||
ObjectNameInfo->Name.MaximumLength = (USHORT)ObjectNameInfo->Name.Length +
|
ObjectNameInfo->Name.MaximumLength = (USHORT)ObjectNameInfo->Name.Length +
|
||||||
sizeof(UNICODE_NULL);
|
sizeof(UNICODE_NULL);
|
||||||
|
}
|
||||||
|
_SEH2_FINALLY
|
||||||
|
{
|
||||||
/* Free buffer and return */
|
/* Free buffer and return */
|
||||||
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
ExFreePoolWithTag(LocalInfo, TAG_IO);
|
||||||
|
} _SEH2_END;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue