Skip to content

Commit f7ac3a9

Browse files
committed
make sure to reject disks with more than 23 logical partitions
1 parent 417e61d commit f7ac3a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/fdisk/pdiskio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,12 @@ static int Read_Extended_Table( int drive, Partition_Table *pDrive )
10431043
p = pDrive->log_drive;
10441044

10451045
do {
1046+
if ( num_drives == MAX_LOGICAL_DRIVES ) {
1047+
/* make sure we bail out if we cannot handle the number of
1048+
logical partitions */
1049+
return 1;
1050+
}
1051+
10461052
error_code = Read_Physical_Sectors(
10471053
drive + 0x80, nep->start_cyl, nep->start_head, nep->start_sect, 1 );
10481054
if ( error_code != 0 ) {

0 commit comments

Comments
 (0)