r15239@tombo: nickm | 2008-04-17 16:22:50 -0400

Backport: 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:r14392
This commit is contained in:
Nick Mathewson 2008-04-17 20:23:24 +00:00
parent fbb0c6eec3
commit 68b2a57ffd
2 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,8 @@ Changes in version 0.2.0.24-rc - 2008-04-0?
- Fix a dumb bug that was preventing us from knowing that we should
preemptively build circuits to handle expected directory requests.
Fixes bug 660. Bugfix on 0.1.2.x.
- Avoid allocating extra space when computing consensuses on
64-bit platforms. Bug spotted by aakova.
Changes in version 0.2.0.23-rc - 2008-03-24

View File

@ -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");