From: Eric Sandeen Date: Sat, 26 Jan 2013 22:40:28 +0000 (+0000) Subject: xfs_repair: Fix free of uninit ptr in xfs_acl_valid() error path X-Git-Tag: v3.1.11~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50c79b8df93c45495e81c15aca65abde469f1565;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: Fix free of uninit ptr in xfs_acl_valid() error path 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 Reviewed-by: Mark Tinguely Signed-off-by: Mark Tinguely --- diff --git a/repair/attr_repair.c b/repair/attr_repair.c index bab65b120..ec7f4a320 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -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;