]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: Fix free of uninit ptr in xfs_acl_valid() error path
authorEric Sandeen <sandeen@redhat.com>
Sat, 26 Jan 2013 22:40:28 +0000 (22:40 +0000)
committerMark Tinguely <tinguely@eagdhcp-232-136.americas.sgi.com>
Thu, 21 Feb 2013 16:09:11 +0000 (10:09 -0600)
This error path:

xfs_acl_valid(xfs_acl_disk_t *daclp)
{
xfs_acl_t *aclp;
...
if (daclp == NULL)
goto acl_invalid;
...
acl_invalid:
free(aclp);

attempts to free garbage; set it to NULL on init to make
it safe.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
repair/attr_repair.c

index bab65b120d678ebba9c895bf54139b024eeab776..ec7f4a320e9a6c50c842acff028607f8614fc1c2 100644 (file)
@@ -1004,7 +1004,7 @@ process_attributes(
 static int
 xfs_acl_valid(xfs_acl_disk_t *daclp)
 {
-       xfs_acl_t       *aclp;
+       xfs_acl_t       *aclp = NULL;
        xfs_acl_entry_t *entry, *e;
        int user = 0, group = 0, other = 0, mask = 0, mask_required = 0;
        int i, j;