diff --git a/libntfs-3g/acls.c b/libntfs-3g/acls.c index 4bfd3652..ab1a3557 100644 --- a/libntfs-3g/acls.c +++ b/libntfs-3g/acls.c @@ -2985,8 +2985,10 @@ static int build_std_permissions(const char *securattr, if (offdacl) { acecnt = le16_to_cpu(pacl->ace_count); offace = offdacl + sizeof(ACL); - } else + } else { acecnt = 0; + offace = 0; + } for (nace = 0; nace < acecnt; nace++) { pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; if (!(pace->flags & INHERIT_ONLY_ACE)) { @@ -3255,8 +3257,10 @@ static int build_ownadmin_permissions(const char *securattr, if (offdacl) { acecnt = le16_to_cpu(pacl->ace_count); offace = offdacl + sizeof(ACL); - } else + } else { acecnt = 0; + offace = 0; + } firstapply = TRUE; isforeign = 3; for (nace = 0; nace < acecnt; nace++) {