dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0312-linux-loader-avoid-overflow-on-initrd-size-calculati.patch

a4d572
From 9fa474528317c2311e2f2ac0fd626316ef7486d4 Mon Sep 17 00:00:00 2001
a4d572
From: Peter Jones <pjones@redhat.com>
a4d572
Date: Fri, 24 Jul 2020 13:57:27 -0400
a4d572
Subject: [PATCH 312/314] linux loader: avoid overflow on initrd size
a4d572
 calculation
a4d572
a4d572
Signed-off-by: Peter Jones <pjones@redhat.com>
a4d572
---
a4d572
 grub-core/loader/linux.c | 4 ++--
a4d572
 1 file changed, 2 insertions(+), 2 deletions(-)
a4d572
a4d572
diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c
a4d572
index c2c7cfcd0fd..61a2e144db0 100644
a4d572
--- a/grub-core/loader/linux.c
a4d572
+++ b/grub-core/loader/linux.c
a4d572
@@ -152,8 +152,8 @@ grub_initrd_init (int argc, char *argv[],
a4d572
   initrd_ctx->nfiles = 0;
a4d572
   initrd_ctx->components = 0;
a4d572
 
a4d572
-  initrd_ctx->components = grub_zalloc (argc
a4d572
-					* sizeof (initrd_ctx->components[0]));
a4d572
+  initrd_ctx->components = grub_calloc (argc,
a4d572
+					sizeof (initrd_ctx->components[0]));
a4d572
   if (!initrd_ctx->components)
a4d572
     return grub_errno;
a4d572
 
a4d572
-- 
a4d572
2.26.2
a4d572