mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NTFS]
Add error-checking to InternalGetNextAttribute(); don't crash if CurrAttr->Length is invalid. svn path=/branches/GSoC_2016/NTFS/; revision=71897
This commit is contained in:
parent
de5cff4b37
commit
7c576a836f
1 changed files with 8 additions and 0 deletions
|
@ -181,6 +181,14 @@ InternalGetNextAttribute(PFIND_ATTR_CONTXT Context)
|
|||
}
|
||||
|
||||
NextAttribute = (PNTFS_ATTR_RECORD)((ULONG_PTR)Context->CurrAttr + Context->CurrAttr->Length);
|
||||
|
||||
if (NextAttribute > Context->LastAttr || NextAttribute < Context->FirstAttr)
|
||||
{
|
||||
DPRINT1("Broken length: 0x%lx!\n", Context->CurrAttr->Length);
|
||||
Context->CurrAttr = (PVOID)-1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Context->Offset += ((ULONG_PTR)NextAttribute - (ULONG_PTR)Context->CurrAttr);
|
||||
Context->CurrAttr = NextAttribute;
|
||||
|
||||
|
|
Loading…
Reference in a new issue