mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
repart: fix free area calculation
Like fdisk_get_last_lba(), fdisk_partition_get_end() return the last sector in the partition. Fixes #28225.
This commit is contained in:
parent
beba8f2e1e
commit
d2eb1f8145
@ -1922,6 +1922,8 @@ static int determine_current_padding(
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Partition has no end!");
|
||||
|
||||
offset = fdisk_partition_get_end(p);
|
||||
assert(offset < UINT64_MAX);
|
||||
offset++; /* The end is one sector before the next partition or padding. */
|
||||
assert(offset < UINT64_MAX / secsz);
|
||||
offset *= secsz;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user