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

5975ab
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a4d572
From: Peter Jones <pjones@redhat.com>
a4d572
Date: Fri, 24 Jul 2020 13:57:27 -0400
5975ab
Subject: [PATCH] linux loader: avoid overflow on initrd size 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
f6e916
index c2c7cfcd0..61a2e144d 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