From: Mateusz Grzonka Date: Wed, 5 Jul 2023 14:34:56 +0000 (+0200) Subject: imsm: Fix possible segfault in check_no_platform() X-Git-Tag: mdadm-4.3~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf1577bf54afe76b77ecaa62df25901739ca8ae9;p=thirdparty%2Fmdadm.git 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 Signed-off-by: Jes Sorensen --- 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;