From 6ff8202fa9e172199e995298d336d9dd87ca8180 Mon Sep 17 00:00:00 2001 From: Steffen Eiden Date: Mon, 25 Jul 2022 12:57:53 +0200 Subject: [PATCH] zipl: Add missing check for a nullpointer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marc Hartmayer Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- 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 ffdc297a..b5bf5b20 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 "