summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 3f298cd9c4..a7a7fcbea3 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2357,6 +2357,7 @@ read_file_to_str_until_eof(int fd, size_t max_bytes_to_read, size_t *sz_out)
pos += r;
} while (r > 0 && pos < max_bytes_to_read);
+ tor_assert(pos < string_max);
*sz_out = pos;
string[pos] = '\0';
return string;