diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-19 12:39:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-19 12:39:14 -0400 |
commit | 4d51dcda2fa75a3841e041ab7c3de325d73e2850 (patch) | |
tree | 0272db19272b519c91447aef1a102db30b03231a /src/ext/tinytest.c | |
parent | d4ad254917ffa0dfba371624f72bc9e163645b8e (diff) | |
download | tor-4d51dcda2fa75a3841e041ab7c3de325d73e2850.tar.gz tor-4d51dcda2fa75a3841e041ab7c3de325d73e2850.zip |
scan-build: limit hashtable size so it always fits in SSIZE_MAX
scan-build recognizes that in theory there could be a numeric overflow
here.
This can't numeric overflow can't trigger IRL, since in order to fill a
hash table with more than P=402653189 buckets with a reasonable load
factor of 0.5, we'd first have P/2 malloced objects to put in it--- and
each of those would have to take take at least sizeof(void*) worth of
malloc overhead plus sizeof(void*) content, which would run you out of
address space anyway on a 32-bit system.
Diffstat (limited to 'src/ext/tinytest.c')
0 files changed, 0 insertions, 0 deletions