Skip to content

Commit

Permalink
Fix potential uninitialized access
Browse files Browse the repository at this point in the history
  • Loading branch information
mnunberg committed Apr 5, 2018
1 parent 3c1198e commit a2ae104
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contrib/bloom.c
Expand Up @@ -166,9 +166,8 @@ int bloom_init(struct bloom *bloom, unsigned entries, double error, unsigned opt
} else {
bloom->bytes = bits / 8;
}
if (options & BLOOM_OPT_FORCE64) {
bloom->force64 = 1;
}

bloom->force64 = (options & BLOOM_OPT_FORCE64);
bloom->hashes = (int)ceil(0.693147180559945 * bloom->bpe); // ln(2)
bloom->bf = (unsigned char *)BLOOM_CALLOC(bloom->bytes, sizeof(unsigned char));
if (bloom->bf == NULL) {
Expand Down

0 comments on commit a2ae104

Please sign in to comment.