Blame SOURCES/acl-2.2.52-setfacl-restore-initialize.patch

0f16a9
From eb123384d1e4001b62a578ec1df53aa23016aed3 Mon Sep 17 00:00:00 2001
0f16a9
From: Andreas Gruenbacher <agruenba@redhat.com>
0f16a9
Date: Fri, 17 Mar 2017 10:17:01 +0100
0f16a9
Subject: [PATCH] setfacl --restore: Silence valgrind
0f16a9
0f16a9
Valgrind complains that setfacl --restore triggers uninitialized memory
0f16a9
accesses to cmd->c_tag and cmd->c_perm of CMD_REMOVE_ACL commands in
0f16a9
do_set (http://savannah.nongnu.org/bugs/?50566).  In this case, the
0f16a9
uninitialized memory accesses have no effect.  Silence valgrind by
0f16a9
initializing cmd->c_tag and cmd->c_perm anyway.
0f16a9
0f16a9
Upstream-commit: 33f01b5d5bd98fceee0ba46cdbddb60b36fc650e
0f16a9
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
0f16a9
---
0f16a9
 setfacl/sequence.c | 9 ++++++++-
0f16a9
 1 file changed, 8 insertions(+), 1 deletion(-)
0f16a9
0f16a9
diff --git a/setfacl/sequence.c b/setfacl/sequence.c
0f16a9
index a418b23..5ed182e 100644
0f16a9
--- a/setfacl/sequence.c
0f16a9
+++ b/setfacl/sequence.c
0f16a9
@@ -29,7 +29,14 @@ cmd_t
0f16a9
 cmd_init(
0f16a9
 	void)
0f16a9
 {
0f16a9
-	return (cmd_t)malloc(sizeof(struct cmd_obj));
0f16a9
+	cmd_t cmd;
0f16a9
+
0f16a9
+	cmd = malloc(sizeof(struct cmd_obj));
0f16a9
+	if (cmd) {
0f16a9
+		cmd->c_tag = ACL_UNDEFINED_TAG;
0f16a9
+		cmd->c_perm = 0;
0f16a9
+	}
0f16a9
+	return cmd;
0f16a9
 }
0f16a9
 
0f16a9
 
0f16a9
-- 
0f16a9
2.9.4
0f16a9