Blame SOURCES/0011-policy.c-Fix-for-compiler-error.patch

c025cf
From 757e55435997e355ee9b03e5d913b5496a3c39a8 Mon Sep 17 00:00:00 2001
c025cf
From: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
c025cf
Date: Tue, 11 Dec 2018 15:04:07 +0100
c025cf
Subject: [RHEL7.7 PATCH 11/21] policy.c: Fix for compiler error
c025cf
MIME-Version: 1.0
c025cf
Content-Type: text/plain; charset=UTF-8
c025cf
Content-Transfer-Encoding: 8bit
c025cf
c025cf
After cd72f9d(policy: support devices with multiple paths.) compilation
c025cf
on old compilers fails because "ā€˜pā€™ may be used uninitialized
c025cf
in this function".
c025cf
c025cf
Initialize it with NULL to prevent this.
c025cf
c025cf
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
c025cf
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
c025cf
---
c025cf
 policy.c | 2 +-
c025cf
 1 file changed, 1 insertion(+), 1 deletion(-)
c025cf
c025cf
diff --git a/policy.c b/policy.c
c025cf
index e3a0671..3c53bd3 100644
c025cf
--- a/policy.c
c025cf
+++ b/policy.c
c025cf
@@ -268,7 +268,7 @@ static int pol_match(struct rule *rule, char **paths, char *type, char **part)
c025cf
 
c025cf
 	for (; rule; rule = rule->next) {
c025cf
 		if (rule->name == rule_path) {
c025cf
-			char *p;
c025cf
+			char *p = NULL;
c025cf
 			int i;
c025cf
 			if (pathok == 0)
c025cf
 				pathok = -1;
c025cf
-- 
c025cf
2.7.5
c025cf