aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-03 15:30:11 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-03 15:30:11 -0500
commite365aee97110c6c6df6f56ca9814d88c3808a2d1 (patch)
tree832874726f999f03d5e10a102d0b84c9c5314713 /src/common
parente09ab69703967716b2765e062ca229e641dba53e (diff)
downloadtor-e365aee97110c6c6df6f56ca9814d88c3808a2d1.tar
tor-e365aee97110c6c6df6f56ca9814d88c3808a2d1.tar.gz
Avoid assertion on read_file_to_str() with size==SIZE_T_CEILING-1
Spotted by doors, fixes bug 2326.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 7a24df813..f206d00c4 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1936,7 +1936,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));