33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
|
From ce0ae3c869dccaff3ed976d58b2d63ce461507e6 Mon Sep 17 00:00:00 2001
|
||
|
From: Steffen Eiden <seiden@linux.ibm.com>
|
||
|
Date: Mon, 25 Jul 2022 12:57:53 +0200
|
||
|
Subject: [PATCH] zipl: Add missing check for a nullpointer.
|
||
|
|
||
|
Fixes a bug that leads to a segmentation fault when no parmline is
|
||
|
provided.
|
||
|
|
||
|
Fixes: 11b401b5 ("zipl: move and make check for maximum command line length dynamic")
|
||
|
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
|
||
|
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
|
||
|
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
|
||
|
---
|
||
|
zipl/src/job.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/zipl/src/job.c b/zipl/src/job.c
|
||
|
index ffdc297..b5bf5b2 100644
|
||
|
--- a/zipl/src/job.c
|
||
|
+++ b/zipl/src/job.c
|
||
|
@@ -790,7 +790,7 @@ check_common_ipl_data(struct job_common_ipl_data *common, const char *section,
|
||
|
if (!max_parm_size)
|
||
|
max_parm_size = LEGACY_MAXIMUM_PARMLINE_SIZE;
|
||
|
|
||
|
- len = strlen(common->parmline);
|
||
|
+ len = common->parmline ? strlen(common->parmline) : 0;
|
||
|
if (len > max_parm_size) {
|
||
|
error_text("The length of the parameters line "
|
||
|
"(%d bytes) exceeds the allowed maximum "
|
||
|
--
|
||
|
2.37.1
|
||
|
|