mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Replace malloc with calloc for writing buffer allocation to ensure memory is zero-initialized
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user