Make preferred_chunk_size avoid overflow, handle big inputs better

Also, add tests for the function.

Closes 20081; bugfix on 0.2.0.16-alpha. This is a Guido Vranken
issue. Thanks, Guido!
This commit is contained in:
Nick Mathewson
2016-09-13 09:07:12 -04:00
parent 4b182dfc23
commit 20c4b01694
4 changed files with 32 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
o Minor bugfixes (allocation):
- Change how we allocate memory for large chunks on buffers, to avoid
a (currently impossible) integer overflow, and to waste less space
when allocating unusually large chunks. Fixes bug 20081; bugfix on
0.2.0.16-alpha. Issue identified by Guido Vranken.