dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0010-policy.c-prevent-NULL-pointer-referencing.patch

8fbece
From 467e6a1b4ece8e552ee638dab7f44a4d235ece1a Mon Sep 17 00:00:00 2001
8fbece
From: Gioh Kim <gi-oh.kim@cloud.ionos.com>
8fbece
Date: Fri, 7 Dec 2018 12:04:44 +0100
8fbece
Subject: [RHEL7.7 PATCH 10/24] policy.c: prevent NULL pointer referencing
8fbece
8fbece
paths could be NULL and paths[0] should be followed by NULL pointer
8fbece
checking.
8fbece
8fbece
Reviewed-by: NeilBrown <neilb@suse.com>
8fbece
Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
8fbece
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
8fbece
---
8fbece
 policy.c | 2 +-
8fbece
 1 file changed, 1 insertion(+), 1 deletion(-)
8fbece
8fbece
diff --git a/policy.c b/policy.c
8fbece
index fa67d55..e3a0671 100644
8fbece
--- a/policy.c
8fbece
+++ b/policy.c
8fbece
@@ -383,7 +383,7 @@ struct dev_policy *path_policy(char **paths, char *type)
8fbece
 	/* Now add any metadata-specific internal knowledge
8fbece
 	 * about this path
8fbece
 	 */
8fbece
-	for (i=0; paths[0] && superlist[i]; i++)
8fbece
+	for (i=0; paths && paths[0] && superlist[i]; i++)
8fbece
 		if (superlist[i]->get_disk_controller_domain) {
8fbece
 			const char *d =
8fbece
 				superlist[i]->get_disk_controller_domain(
8fbece
-- 
8fbece
2.7.5
8fbece