mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2024-09-09 11:01:31 +02:00
Windows: Add checks on IOCTL_DISK_GET_DRIVE_LAYOUT_EX response to make Coverity happy.
This commit is contained in:
parent
1662abb707
commit
70d083bfb2
1 changed files with 51 additions and 47 deletions
|
@ -11995,9 +11995,12 @@ void UpdateMountableHostDeviceList ()
|
||||||
(LPVOID) buffer.data(),
|
(LPVOID) buffer.data(),
|
||||||
(DWORD) buffer.size(),
|
(DWORD) buffer.size(),
|
||||||
(LPDWORD) &bytesReturned,
|
(LPDWORD) &bytesReturned,
|
||||||
NULL))
|
NULL) && (bytesReturned >= sizeof (DRIVE_LAYOUT_INFORMATION_EX)))
|
||||||
{
|
{
|
||||||
PDRIVE_LAYOUT_INFORMATION_EX layout = (PDRIVE_LAYOUT_INFORMATION_EX) buffer.data();
|
PDRIVE_LAYOUT_INFORMATION_EX layout = (PDRIVE_LAYOUT_INFORMATION_EX) buffer.data();
|
||||||
|
// sanity checks
|
||||||
|
if (layout->PartitionCount <= 256)
|
||||||
|
{
|
||||||
for (DWORD i = 0; i < layout->PartitionCount; i++)
|
for (DWORD i = 0; i < layout->PartitionCount; i++)
|
||||||
{
|
{
|
||||||
if (layout->PartitionEntry[i].PartitionStyle == PARTITION_STYLE_MBR)
|
if (layout->PartitionEntry[i].PartitionStyle == PARTITION_STYLE_MBR)
|
||||||
|
@ -12054,6 +12057,7 @@ void UpdateMountableHostDeviceList ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (bIsDynamic)
|
if (bIsDynamic)
|
||||||
dynamicVolumesPresent = true;
|
dynamicVolumesPresent = true;
|
||||||
|
|
Loading…
Reference in a new issue