Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ AARU_EXPORT void *AARU_CALL aaruf_create(const char *filepath, const uint32_t me
TRACE("Generating random GUID");
generate_random_bytes(ctx->header.guid, GUID_SIZE);

ctx->readableSectorTags = (bool *)malloc(sizeof(bool) * MaxSectorTag);
ctx->readableSectorTags = (bool *)malloc(sizeof(bool) * (MaxSectorTag + 1));

if(ctx->readableSectorTags == NULL)
{
Expand All @@ -371,7 +371,7 @@ AARU_EXPORT void *AARU_CALL aaruf_create(const char *filepath, const uint32_t me
return NULL;
}

memset(ctx->readableSectorTags, 0, sizeof(bool) * MaxSectorTag);
memset(ctx->readableSectorTags, 0, sizeof(bool) * (MaxSectorTag + 1));

// Initialize image info
TRACE("Initializing image info");
Expand Down
4 changes: 2 additions & 2 deletions src/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ AARU_EXPORT void *AARU_CALL aaruf_open(const char *filepath, const bool resume_m
TRACE("Opening image version %d.%d", ctx->header.imageMajorVersion, ctx->header.imageMinorVersion);

TRACE("Allocating memory for readable sector tags bitmap");
ctx->readableSectorTags = (bool *)malloc(sizeof(bool) * MaxSectorTag);
ctx->readableSectorTags = (bool *)malloc(sizeof(bool) * (MaxSectorTag + 1));

if(ctx->readableSectorTags == NULL)
{
Expand All @@ -442,7 +442,7 @@ AARU_EXPORT void *AARU_CALL aaruf_open(const char *filepath, const bool resume_m
return NULL;
}

memset(ctx->readableSectorTags, 0, sizeof(bool) * MaxSectorTag);
memset(ctx->readableSectorTags, 0, sizeof(bool) * (MaxSectorTag + 1));

TRACE("Setting up image info");

Expand Down