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);
p = new_target;
if (stripped_nchars == 6) {
/* Include \??\ prefix if it was present before */
- wmemcpy(p, L"\\??\\", 4);
- p += 4;
+ p = wmempcpy(p, L"\\??\\", 4);
}
/* Print name excludes the \??\ if present. */
}
} else {
size_t len_to_copy = min(len, ctx->bytes_remaining);
- memcpy(ctx->read_prefix_ctx_or_buf, data, len_to_copy);
+ ctx->read_prefix_ctx_or_buf = mempcpy(ctx->read_prefix_ctx_or_buf,
+ data,
+ len_to_copy);
ctx->bytes_remaining -= len_to_copy;
- ctx->read_prefix_ctx_or_buf += len_to_copy;
}
return ERROR_SUCCESS;
}