X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fsecurity.c;h=94660de85f28301eb47589916ea7e93d01fa99ef;hp=37b9a063cfe5bec6d4793fe2586a54427f5654fc;hb=32844c59e618cfaf1999e81e32b5e18fcb13a5b9;hpb=f8698b9c814a62a117982701b9551f699553b2a4 diff --git a/src/security.c b/src/security.c index 37b9a063..94660de8 100644 --- a/src/security.c +++ b/src/security.c @@ -556,6 +556,9 @@ sd_set_add_sd(struct sd_set *sd_set, const char descriptor[], size_t size) new->security_id = sd->num_entries; copy_hash(new->hash, hash); + /* There typically are only a few dozen security descriptors in a + * directory tree, so expanding the array of security descriptors by + * only 1 extra space each time should not be a problem. */ descriptors = REALLOC(sd->descriptors, (sd->num_entries + 1) * sizeof(sd->descriptors[0])); if (!descriptors)