diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-01-03 15:55:41 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-01-03 15:55:41 -0500 |
commit | a87a55a9b692ab9f039be15f8af59a159b52d8f2 (patch) | |
tree | 73538d733debe368ac52bb5e2cfa3280d3321b06 | |
parent | a96b46570fef6f883a385ad2220f8c48061defff (diff) | |
parent | f089804332c0289159ec432d8ce82bb1ed6316aa (diff) | |
download | tor-a87a55a9b692ab9f039be15f8af59a159b52d8f2.tar.gz tor-a87a55a9b692ab9f039be15f8af59a159b52d8f2.zip |
Merge remote branch 'origin/maint-0.2.2'
-rw-r--r-- | changes/bug2326 | 6 | ||||
-rw-r--r-- | src/common/util.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/changes/bug2326 b/changes/bug2326 new file mode 100644 index 0000000000..239a383faf --- /dev/null +++ b/changes/bug2326 @@ -0,0 +1,6 @@ + o Minor bugfixes + - Fix a bug where we would assert if we ever had a + cached-descriptors.new file (or another file read directly into + memory) of exactly SIZE_T_CEILING bytes. Found by doors; fixes + bug 2326; bugfix on 0.2.1.25. + diff --git a/src/common/util.c b/src/common/util.c index c38f1d10cc..e676530b29 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2064,7 +2064,7 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out) return NULL; } - if ((uint64_t)(statbuf.st_size)+1 > SIZE_T_CEILING) + if ((uint64_t)(statbuf.st_size)+1 >= SIZE_T_CEILING) return NULL; string = tor_malloc((size_t)(statbuf.st_size+1)); |