]> wimlib.net Git - wimlib/blobdiff - src/security.c
test-imagex-mount: Check for /dev/fuse both readable and writable
[wimlib] / src / security.c
index 628b93584d1dfff77727ecc9f845c85c2b6a6152..788426c25dd7446d8afefb4a903ae3b2e01f9538 100644 (file)
@@ -146,7 +146,7 @@ struct wim_security_data_disk {
  * the validation in libntfs-3g.
  */
 static void
-empty_sacl_fixup(SECURITY_DESCRIPTOR_RELATIVE *descr, size_t *size_p)
+empty_sacl_fixup(SECURITY_DESCRIPTOR_RELATIVE *descr, u64 *size_p)
 {
        /* No-op if no NTFS-3g support, or if NTFS-3g is version 2013 or later
         * */
@@ -568,13 +568,12 @@ sd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size)
        new = MALLOC(sizeof(*new));
        if (!new)
                goto out;
-       descr_copy = MALLOC(size);
+
+       descr_copy = memdup(descriptor, size);
        if (!descr_copy)
                goto out_free_node;
 
        sd = sd_set->sd;
-
-       memcpy(descr_copy, descriptor, size);
        new->security_id = sd->num_entries;
        copy_hash(new->hash, hash);