dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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