loader/linux: Avoid overflow on initrd size calculation
Signed-off-by: Peter Jones <pjones@redhat.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
f7bd9986f6
commit
0dcbf3652b
1 changed files with 1 additions and 2 deletions
|
@ -151,8 +151,7 @@ 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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue