diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-02 12:48:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-02 12:48:34 -0400 |
commit | 00ffccd9a6d9b7f484c2e421be33aea3975a2879 (patch) | |
tree | c0e01dfadc0a10feb98bbb517715c384ccacab1c /src/or/channel.c | |
parent | e3c143f5214b4a2d37dbb47940eaf2cc2e212f86 (diff) | |
download | tor-00ffccd9a6d9b7f484c2e421be33aea3975a2879.tar.gz tor-00ffccd9a6d9b7f484c2e421be33aea3975a2879.zip |
Another clang analyzer complaint wrt HT_GENERATE
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro
with the result of a product. But that makes any sane analyzer
worry about overflow.
This patch keeps HT_GENERATE having its old semantics, since we
aren't the only project using ht.h. Instead, define a HT_GENERATE2
that takes a reallocarrayfn.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r-- | src/or/channel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/channel.c b/src/or/channel.c index ffd68493d0..4129839fea 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -108,8 +108,8 @@ channel_idmap_eq(const channel_idmap_entry_t *a, HT_PROTOTYPE(channel_idmap, channel_idmap_entry_s, node, channel_idmap_hash, channel_idmap_eq); -HT_GENERATE(channel_idmap, channel_idmap_entry_s, node, channel_idmap_hash, - channel_idmap_eq, 0.5, tor_malloc, tor_realloc, tor_free_); +HT_GENERATE2(channel_idmap, channel_idmap_entry_s, node, channel_idmap_hash, + channel_idmap_eq, 0.5, tor_reallocarray_, tor_free_); static cell_queue_entry_t * cell_queue_entry_dup(cell_queue_entry_t *q); static void cell_queue_entry_free(cell_queue_entry_t *q, int handed_off); |