]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (gpt) make sure device is large enough
authorKarel Zak <kzak@redhat.com>
Wed, 30 Sep 2020 09:44:03 +0000 (11:44 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 11:06:52 +0000 (12:06 +0100)
commita9d8303533888230198614406dcb9921004fa115
treeb373c01b2298c27726a35bf8c1c85a7f4079de5d
parent18e5f177034531a165a3af2d2f344eac0a79d2a6
libfdisk: (gpt) make sure device is large enough

The current code creates GPT header and partitions arrays (with 128
entries ...) although there is no space for all the stuff. This patch
forces fdisk_create_disklabel() to return -ENOSPC if the last and first
usable LBA calculation is out of device size.

Addresses: https://github.com/karelzak/util-linux/issues/1147
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c