mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
r15230@tombo: nickm | 2008-04-17 16:18:08 -0400
Do not allocate excess space for named_flag and unnamed_flag in dirvote.c. Fixes bug 662. Not a dangerous bug: sizeof(int*) is at least as big as sizeof(int) everywhere. svn:r14391
This commit is contained in:
parent
864f4df905
commit
1b9c06ab96
@ -22,6 +22,8 @@ Changes in version 0.2.1.1-alpha - 2008-??-??
|
||||
0.2.0.1-alpha. Spotted by lodger.
|
||||
- Reduce the default smartlist size from 32 to 16; it turns out that
|
||||
most smartlists hold around 8-12 elements tops.
|
||||
- Avoid allocating extra space when computing consensuses on
|
||||
64-bit platforms. Bug spotted by aakova.
|
||||
|
||||
o Minor features:
|
||||
- Allow separate log levels to be configured for different logging
|
||||
|
@ -641,8 +641,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
||||
n_voter_flags = tor_malloc_zero(sizeof(int) * smartlist_len(votes));
|
||||
n_flag_voters = tor_malloc_zero(sizeof(int) * smartlist_len(flags));
|
||||
flag_map = tor_malloc_zero(sizeof(int*) * smartlist_len(votes));
|
||||
named_flag = tor_malloc_zero(sizeof(int*) * smartlist_len(votes));
|
||||
unnamed_flag = tor_malloc_zero(sizeof(int*) * smartlist_len(votes));
|
||||
named_flag = tor_malloc_zero(sizeof(int) * smartlist_len(votes));
|
||||
unnamed_flag = tor_malloc_zero(sizeof(int) * smartlist_len(votes));
|
||||
for (i = 0; i < smartlist_len(votes); ++i)
|
||||
unnamed_flag[i] = named_flag[i] = -1;
|
||||
chosen_named_idx = smartlist_string_pos(flags, "Named");
|
||||
|
Loading…
Reference in New Issue
Block a user