ExtendedTools: Fix crash enumerating reparse layout entry
@@ -1048,7 +1048,9 @@ PPH_LIST EtFindVolumeFilesWithSecurityId(
break;
}
- fileLayoutNameEntry = PTR_ADD_OFFSET(fileLayoutEntry, fileLayoutEntry->FirstNameOffset);
+ if (!fileLayoutEntry->ExtraInfoOffset)
+ continue;
+
fileLayoutInfoEntry = PTR_ADD_OFFSET(fileLayoutEntry, fileLayoutEntry->ExtraInfoOffset);
if (fileLayoutInfoEntry->SecurityId == SecurityId)
@@ -1058,6 +1060,10 @@ PPH_LIST EtFindVolumeFilesWithSecurityId(
volumeFileList = PhCreateList(10);
}
+ if (fileLayoutEntry->FirstNameOffset)
+ {
+ fileLayoutNameEntry = PTR_ADD_OFFSET(fileLayoutEntry, fileLayoutEntry->FirstNameOffset);
+
while (TRUE)
{
PPH_STRING fileName = PhCreateStringEx(fileLayoutNameEntry->FileName, fileLayoutNameEntry->FileNameLength);
@@ -1081,6 +1087,7 @@ PPH_LIST EtFindVolumeFilesWithSecurityId(
}
}
}
+ }
if (!NT_SUCCESS(status))
break;
