diff options
author | Mateusz Grzonka <mateusz.grzonka@intel.com> | 2023-07-05 16:34:56 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-08-07 17:01:54 -0400 |
commit | cf1577bf54afe76b77ecaa62df25901739ca8ae9 (patch) | |
tree | d7c53803a9166ce6333bbc8792a33f5fbf2fbffc | |
parent | 75350d87c86001c47076e1f62478079bdc072223 (diff) | |
download | mdadm-test-cf1577bf54afe76b77ecaa62df25901739ca8ae9.tar.gz |
imsm: Fix possible segfault in check_no_platform()
conf_line() may return NULL, which is not handled and might cause
segfault.
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r-- | super-intel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index ae0f4a8c..4ef33d31 100644 --- a/super-intel.c +++ b/super-intel.c @@ -650,6 +650,11 @@ static int check_no_platform(void) char *l = conf_line(fp); char *w = l; + if (l == NULL) { + fclose(fp); + return 0; + } + do { if (strcmp(w, search) == 0) no_platform = 1; |