summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2017-03-17 10:17:01 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2017-03-17 10:17:01 +0100
commit33f01b5d5bd98fceee0ba46cdbddb60b36fc650e (patch)
tree3d89ee13b906bc9178bb4d2846a444125715fb68
parent38f32ea1865bcc44185f4118fde469cb962cff68 (diff)
downloadacl-33f01b5d5bd98fceee0ba46cdbddb60b36fc650e.tar.gz
setfacl --restore: Silence valgrind
Valgrind complains that setfacl --restore triggers uninitialized memory accesses to cmd->c_tag and cmd->c_perm of CMD_REMOVE_ACL commands in do_set (http://savannah.nongnu.org/bugs/?50566). In this case, the uninitialized memory accesses have no effect. Silence valgrind by initializing cmd->c_tag and cmd->c_perm anyway.
-rw-r--r--tools/sequence.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/sequence.c b/tools/sequence.c
index be4788b..d7310d4 100644
--- a/tools/sequence.c
+++ b/tools/sequence.c
@@ -30,7 +30,14 @@ cmd_t
cmd_init(
void)
{
- return (cmd_t)malloc(sizeof(struct cmd_obj));
+ cmd_t cmd;
+
+ cmd = malloc(sizeof(struct cmd_obj));
+ if (cmd) {
+ cmd->c_tag = ACL_UNDEFINED_TAG;
+ cmd->c_perm = 0;
+ }
+ return cmd;
}