0007-Use-MAXIMUM_PARTS-instead-of-VLA.patch (918B)
- From abcdd92972cc92840e8db22d7018c44dbb9ec2f4 Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Mon, 24 Jun 2019 23:41:53 -0700
- Subject: [PATCH] Use MAXIMUM_PARTS instead of VLA
- This is the upper bound on the pte array, so just use it as the
- static array length.
- ---
- libfdisk/src/dos.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
- diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
- index 7a1f6ea34..967b7bd19 100644
- --- a/libfdisk/src/dos.c
- +++ b/libfdisk/src/dos.c
- @@ -1624,8 +1624,7 @@ static int dos_verify_disklabel(struct fdisk_context *cxt)
- {
- size_t i, j;
- fdisk_sector_t total = 1, n_sectors = cxt->total_sectors;
- - fdisk_sector_t first[cxt->label->nparts_max],
- - last[cxt->label->nparts_max];
- + fdisk_sector_t first[MAXIMUM_PARTS], last[MAXIMUM_PARTS];
- struct dos_partition *p;
- struct fdisk_dos_label *l = self_label(cxt);
- int nerrors = 0;
- --
- 2.28.0