blob: 8f95cfb9baaadef80c1682d6cb7cf7b28766b0b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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
|