From 71400ab2765e9cced6dd01d4c5999004432ed115 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 29 Sep 2025 14:46:55 +0100 Subject: [PATCH] Replace malloc with calloc for writing buffer allocation to ensure memory is zero-initialized --- src/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write.c b/src/write.c index 7bf319e..23c2391 100644 --- a/src/write.c +++ b/src/write.c @@ -101,7 +101,7 @@ int32_t aaruf_write_sector(void *context, uint64_t sectorAddress, uint8_t *data, TRACE("Setting max buffer size to %u bytes", maxBufferSize); TRACE("Allocating memory for writing buffer"); - ctx->writingBuffer = (uint8_t *)malloc(maxBufferSize); + ctx->writingBuffer = (uint8_t *)calloc(1, maxBufferSize); if(ctx->writingBuffer == NULL) { FATAL("Could not allocate memory");