logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0007-Use-MAXIMUM_PARTS-instead-of-VLA.patch (918B)


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