nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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