Skip to content

Commit

Permalink
make sure to reject disks with more than 23 logical partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckmann committed Jan 18, 2025
1 parent 417e61d commit f7ac3a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/fdisk/pdiskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,12 @@ static int Read_Extended_Table( int drive, Partition_Table *pDrive )
p = pDrive->log_drive;

do {
if ( num_drives == MAX_LOGICAL_DRIVES ) {
/* make sure we bail out if we cannot handle the number of
logical partitions */
return 1;
}

error_code = Read_Physical_Sectors(
drive + 0x80, nep->start_cyl, nep->start_head, nep->start_sect, 1 );
if ( error_code != 0 ) {
Expand Down

0 comments on commit f7ac3a9

Please sign in to comment.