From: Rose Date: Mon, 19 May 2025 19:19:57 +0000 (-0400) Subject: Calculate size of arrays instead of assuming they are always 6 X-Git-Tag: v3.8.0~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2622%2Fhead;p=thirdparty%2Flibarchive.git Calculate size of arrays instead of assuming they are always 6 --- diff --git a/libarchive/archive_disk_acl_darwin.c b/libarchive/archive_disk_acl_darwin.c index 48ad01651..12c3587c5 100644 --- a/libarchive/archive_disk_acl_darwin.c +++ b/libarchive/archive_disk_acl_darwin.c @@ -195,7 +195,7 @@ add_trivial_nfs4_acl(struct archive_entry *entry) } else if ((mode & 0010) || (mode & 0001)) tacl_entry[1].permset |= eperm; - for (i = 0; i < 6; i++) { + for (i = 0; i < sizeof(tacl_entry) / sizeof(tacl_entry[0]); i++) { if (tacl_entry[i].permset != 0) { archive_entry_acl_add_entry(entry, tacl_entry[i].type, tacl_entry[i].permset,