]> 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>
Wed, 30 Sep 2020 09:44:03 +0000 (11:44 +0200)
commitffac9652c737b97069732a6a2b1eae8d3db40d57
treeb6008f2ce794335f52d51d3d9afd3aeba83e7512
parente9131920485962f33bd32b492cb93078ee7a3c34
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