[PATCH] imsm: Fix possible segfault in check_no_platform()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



conf_line() may return NULL, which is not handled and might cause
segfault.

Signed-off-by: Mateusz Grzonka <mateusz.grzonka@xxxxxxxxx>
---
 super-intel.c | 5 +++++
 1 file changed, 5 insertions(+)

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;
-- 
2.26.2




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux