mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Add checks on IOCTL_DISK_GET_DRIVE_LAYOUT_EX response to make Coverity happy.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user