nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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