grub2/SOURCES/0312-linux-loader-avoid-ove...

26 lines
879 B
Diff
Raw Normal View History

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