diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-09-13 10:34:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-14 09:51:24 -0400 |
commit | 37953497d8689bdde65837b00f56bf8ff1e0e459 (patch) | |
tree | eba5ce37971b301dffc9fe788b2ab1d439717284 /changes | |
parent | 582f2187a769ea723f6bf13bc91f7a4b3c861408 (diff) | |
download | tor-37953497d8689bdde65837b00f56bf8ff1e0e459.tar.gz tor-37953497d8689bdde65837b00f56bf8ff1e0e459.zip |
Don't compute ((uint64_t)1)<<64 in round_to_power_of_2
This would be undefined behavior if it happened. (It can't actually
happen as we're using round_to_power_of_2, since we would have to
be trying to allocate exabytes of data.)
While we're at it, fix the behavior of round_to_power_of_2(0),
and document the function better.
Fix for bug 6831.
Diffstat (limited to 'changes')
-rw-r--r-- | changes/bug6831 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/changes/bug6831 b/changes/bug6831 new file mode 100644 index 0000000000..ac4775ba83 --- /dev/null +++ b/changes/bug6831 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Fix round_to_power_of_2 so it doesn't invoke undefined behavior + with large values. This was untriggered, but nevertheless incorrect. + Fixes bug 6831; bugfix on 0.2.0.1-alpha. |