From 969a439aaa830090313d49110d4d70885d7a1644 Mon Sep 17 00:00:00 2001 From: Eduard Shishkin Date: Mon, 4 Oct 2021 18:07:07 +0200 Subject: [PATCH] zipl: check add_envblk predicate when setting stage3_parms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set stage3_parms.envblk_len to 0, if add_envblk is false. This fixes segmentation fault when performing job with not defined zIPL environment (e.g. installing SCSI dump) Signed-off-by: Eduard Shishkin Tested-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- zipl/src/bootmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 14cecc6c..a65ef823 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -675,7 +675,8 @@ static int add_ipl_program(int fd, char *filename, IMAGE_ENTRY, (info->type == disk_type_scsi) ? 0 : 1, flags, ipl->image_addr, image_size, - ipl->envblk_addr, envblk->size); + ipl->envblk_addr, + add_envblk ? envblk->size : 0); if (rc) { free(table); return rc;