summaryrefslogtreecommitdiff
path: root/setfacl
diff options
context:
space:
mode:
authorMarkus Steinborn <msteinbo>2009-12-17 16:24:17 -0800
committerBrandon Philips <brandon@ifup.org>2009-12-17 16:24:17 -0800
commita1815d4ad4ffe84e8f7d128a38955e3dab306e0d (patch)
treef8a42adbfcfa5227e2bd433ebeec600b10782483 /setfacl
parentfd34ef53234f465bf12cd51ca3a7bb056856e3dd (diff)
downloadacl-a1815d4ad4ffe84e8f7d128a38955e3dab306e0d.tar.gz
setfacl: fix restore crash on malformed input
Malformed input to setfacl --restore can cause a crash due to a double free. Ensure that freed memory is set to NULL. Fixes this bug: https://savannah.nongnu.org/bugs/index.php?28185 Signed-off-by: Brandon Philips <bphilips@suse.de>
Diffstat (limited to 'setfacl')
-rw-r--r--setfacl/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/setfacl/parse.c b/setfacl/parse.c
index b333beb..e7e6add 100644
--- a/setfacl/parse.c
+++ b/setfacl/parse.c
@@ -525,8 +525,10 @@ read_acl_comments(
return -1;
return comments_read;
fail:
- if (path_p && *path_p)
+ if (path_p && *path_p) {
free(*path_p);
+ *path_p = NULL;
+ }
return -EINVAL;
}