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

Bug fix in allocation memory for non-multiple of 8 sizes #11

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

Jgmedina95
Copy link
Contributor

Attempt to fix bug in size allocation for non-multiples of 8.

b->data = calloc((size + 7) / 8, 1);

and then in the bloom_read function
b->data = (char *)malloc((m + 7) / 8);

To avoid issues with older version, I've changed FILE_VERSION to 2u
and then handle different versions with if statements when reading saved bloom filters at the end.
Hard to test whether this change will affect older versions, but this version handling approach
will work as a safeguard without having issues with bloom filters saved before this change.

@whitead whitead merged commit 3d6179b into whitead:main Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants