fix(lib-pack): Use calloc in pack_file_copy instead of malloc

This commit is contained in:
Rachel 2025-01-16 21:31:33 -08:00
parent ee88a6ccc3
commit a3ea8f0037

View File

@ -21,7 +21,7 @@
void narc_pack_file_copy(struct vfs_pack_ctx *ctx, unsigned char *image, const uint32_t size) void narc_pack_file_copy(struct vfs_pack_ctx *ctx, unsigned char *image, const uint32_t size)
{ {
unsigned char *copy = malloc(size); unsigned char *copy = calloc(size, 1);
memcpy(copy, image, size); memcpy(copy, image, size);
narc_pack_file(ctx, copy, size); narc_pack_file(ctx, copy, size);