diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-04-17 20:23:13 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-04-17 20:23:13 +0000 |
commit | 1b9c06ab96709464b4ba8d934625783f0454e11f (patch) | |
tree | a5523d2720e10b0fb134e9b05157811c090d26b7 /src/or/dirvote.c | |
parent | 864f4df905b2068b1bca75d3c7c9ce4c70093a69 (diff) | |
download | tor-1b9c06ab96709464b4ba8d934625783f0454e11f.tar.gz tor-1b9c06ab96709464b4ba8d934625783f0454e11f.zip |
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
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index fbbd82ee28..e4afacc61d 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -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"); |