- zipl: Add missing check for a nullpointer (#2113884)

- Resolves: #2113884
This commit is contained in:
Dan Horák 2022-08-04 13:51:39 +02:00
parent cfecddc2b2
commit 1985de51da
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 2844d07e4bba2301fef66f56574c92054bac7cac 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

View File

@ -10,7 +10,7 @@
Name: s390utils
Summary: Utilities and daemons for IBM z Systems
Version: 2.22.0
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 2
License: MIT
ExclusiveArch: s390 s390x
@ -903,6 +903,10 @@ User-space development files for the s390/s390x architecture.
%changelog
* Thu Aug 04 2022 Dan Horák <dhorak@redhat.com> - 2:2.22.0-2
- zipl: Add missing check for a nullpointer (#2113884)
- Resolves: #2113884
* Mon Jul 11 2022 Dan Horák <dhorak@redhat.com> - 2:2.22.0-1
- rebased to 2.22.0 (#2044205)
- add tool to persistently configure vfio-ap devices (#1870699)