Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized Fingerprints in binary_fuse filters. #56

Merged
merged 1 commit into from
Jul 12, 2024
Merged
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
6 changes: 4 additions & 2 deletions include/binaryfusefilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ static inline bool binary_fuse8_allocate(uint32_t size,
filter->ArrayLength =
(filter->SegmentCount + arity - 1) * filter->SegmentLength;
filter->SegmentCountLength = filter->SegmentCount * filter->SegmentLength;
filter->Fingerprints = (uint8_t*)malloc(filter->ArrayLength);
filter->Fingerprints =
(uint8_t *)calloc(filter->ArrayLength, sizeof(uint8_t));
return filter->Fingerprints != NULL;
}

Expand Down Expand Up @@ -530,7 +531,8 @@ static inline bool binary_fuse16_allocate(uint32_t size,
filter->ArrayLength =
(filter->SegmentCount + arity - 1) * filter->SegmentLength;
filter->SegmentCountLength = filter->SegmentCount * filter->SegmentLength;
filter->Fingerprints = (uint16_t*)malloc(filter->ArrayLength * sizeof(uint16_t));
filter->Fingerprints =
(uint16_t *)calloc(filter->ArrayLength, sizeof(uint16_t));
return filter->Fingerprints != NULL;
}

Expand Down
Loading