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 23:01:54 +0200 |
commit | cf1577bf54afe76b77ecaa62df25901739ca8ae9 (patch) | |
tree | d7c53803a9166ce6333bbc8792a33f5fbf2fbffc /super-intel.c | |
parent | enable RAID for SATA under VMD (diff) | |
download | mdadm-cf1577bf54afe76b77ecaa62df25901739ca8ae9.tar.xz mdadm-cf1577bf54afe76b77ecaa62df25901739ca8ae9.zip |
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>
Diffstat (limited to 'super-intel.c')
-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; |