Blame SOURCES/0052-libmultipath-check-for-null-wwid-before-strcmp.patch

05be62
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
05be62
From: Benjamin Marzinski <bmarzins@redhat.com>
05be62
Date: Mon, 4 Jan 2021 21:59:54 -0600
05be62
Subject: [PATCH] libmultipath: check for null wwid before strcmp
05be62
05be62
Commit 749aabd0 (libmultipath: ignore multipaths sections without wwid
05be62
option) removed all mpentries with a NULL wwid, but didn't stop strcmp()
05be62
from being run on them in merge_mptable(). The result of strcmp() with
05be62
a NULL parameter is undefined, so fix that.
05be62
05be62
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
05be62
05be62
Reviewed-by: Martin Wilck <mwilck@suse.com>
05be62
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
05be62
---
05be62
 libmultipath/config.c | 2 +-
05be62
 1 file changed, 1 insertion(+), 1 deletion(-)
05be62
05be62
diff --git a/libmultipath/config.c b/libmultipath/config.c
05be62
index dc81c994..dd645f17 100644
05be62
--- a/libmultipath/config.c
05be62
+++ b/libmultipath/config.c
05be62
@@ -453,7 +453,7 @@ void merge_mptable(vector mptable)
05be62
 		}
05be62
 		j = i + 1;
05be62
 		vector_foreach_slot_after(mptable, mp2, j) {
05be62
-			if (strcmp(mp1->wwid, mp2->wwid))
05be62
+			if (!mp2->wwid || strcmp(mp1->wwid, mp2->wwid))
05be62
 				continue;
05be62
 			condlog(1, "%s: duplicate multipath config section for %s",
05be62
 				__func__, mp1->wwid);
05be62
-- 
05be62
2.17.2
05be62