Author: hbelusca Date: Tue May 9 22:09:06 2017 New Revision: 74516
URL: http://svn.reactos.org/svn/reactos?rev=74516&view=rev Log: [USETUP]: Fix the primary/extended partitions creation checks introduced in r63392 : indeed this is if there are *already* 4 (primary) partitions in the table that we cannot create new primary/extended partitions. Otherwise with the old (broken) checks, we allowed creating more than 4 partitions, and then we overflowed over memory and corrupted the partition list structures.
Modified: trunk/reactos/base/setup/usetup/partlist.c
Modified: trunk/reactos/base/setup/usetup/partlist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist.... ============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Tue May 9 22:09:06 2017 @@ -3550,8 +3550,8 @@ if (PartEntry->IsPartitioned == TRUE) return ERROR_NEW_PARTITION;
- /* Fail if there are more than 4 partitions in the list */ - if (GetPrimaryPartitionCount(DiskEntry) > 4) + /* Fail if there are already 4 primary partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) >= 4) return ERROR_PARTITION_TABLE_FULL;
return ERROR_SUCCESS; @@ -3572,8 +3572,8 @@ if (PartEntry->IsPartitioned == TRUE) return ERROR_NEW_PARTITION;
- /* Fail if there are more than 4 partitions in the list */ - if (GetPrimaryPartitionCount(DiskEntry) > 4) + /* Fail if there are already 4 primary partitions in the list */ + if (GetPrimaryPartitionCount(DiskEntry) >= 4) return ERROR_PARTITION_TABLE_FULL;
/* Fail if there is another extended partition in the list */