mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Maybe fix #471. Compute the size of bitfields more correctly. Nick, please check.
svn:r10941
This commit is contained in:
@@ -282,7 +282,7 @@ typedef unsigned int bitarray_t;
|
||||
static INLINE bitarray_t *
|
||||
bitarray_init_zero(int n_bits)
|
||||
{
|
||||
size_t sz = (n_bits+BITARRAY_MASK) & BITARRAY_MASK;
|
||||
size_t sz = (n_bits+BITARRAY_MASK) / (1u << BITARRAY_SHIFT);
|
||||
return tor_malloc_zero(sz*sizeof(unsigned int));
|
||||
}
|
||||
/** Free the bit array <b>ba</b>. */
|
||||
|
||||
Reference in New Issue
Block a user