dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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