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

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