LibPartition: Fix end block off by one error

Previously, end block was inconsistent. GUIDPartitionTable treated
end block as an inclusive bound, while MBRPartitionTable and
EBRPartitionTable treated end block as an exclusive bound.
Now all three treat end block as an inclusive upper bound.
This commit is contained in:
Samuel Bowman 2022-06-28 19:06:05 -04:00 committed by Linus Groh
commit 2f8c20816e
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00
3 changed files with 3 additions and 6 deletions

View file

@ -77,7 +77,7 @@ EBRPartitionTable::EBRPartitionTable(NonnullRefPtr<Core::File> device)
if (entry.offset == 0x00) {
continue;
}
MUST(m_partitions.try_empend(entry.offset, (entry.offset + entry.length), entry.type));
MUST(m_partitions.try_empend(entry.offset, (entry.offset + entry.length) - 1, entry.type));
}
}