Skip to content

Commit 10119d1

Browse files
committed
restore MAX_PARTITIONS
1 parent d770df3 commit 10119d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/drive.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,9 +2547,8 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
25472547
// "The goggles, they do nothing!"
25482548
RefreshDriveLayout(hDrive);
25492549

2550-
const int max_parts = 4;
25512550
size = sizeof(DriveLayoutEx) - ((partition_style == PARTITION_STYLE_GPT) ?
2552-
((max_parts - pi) * sizeof(PARTITION_INFORMATION_EX)) : 0);
2551+
((MAX_PARTITIONS - pi) * sizeof(PARTITION_INFORMATION_EX)) : 0);
25532552
// The DRIVE_LAYOUT_INFORMATION_EX used by Microsoft, with its 1-sized array, is designed to overrun...
25542553
// coverity[overrun-buffer-arg]
25552554
if (!DeviceIoControl(hDrive, IOCTL_DISK_SET_DRIVE_LAYOUT_EX, (BYTE*)&DriveLayoutEx, size, NULL, 0, &size, NULL)) {

0 commit comments

Comments
 (0)