[PATCH 4/8] xfs_repair: Fix free of uninit ptr in xfs_acl_valid() error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 repair/attr_repair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/repair/attr_repair.c b/repair/attr_repair.c
index bab65b1..ec7f4a3 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;
-- 
1.7.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux