diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-05-09 11:13:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-09 11:13:22 -0400 |
commit | 9f5b71a7cafbaf1468ec9cb72b8061343c1fae98 (patch) | |
tree | 52642749f4efc73775f3d4ac68bd3ec02b786944 /src/or/rephist.c | |
parent | b2cb3c33aca192c157ad3ff326b869e3f87c7c0d (diff) | |
download | tor-9f5b71a7cafbaf1468ec9cb72b8061343c1fae98.tar.gz tor-9f5b71a7cafbaf1468ec9cb72b8061343c1fae98.zip |
Add a check and a cast in rephist.c to fix a warning
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 96087f92e7..72a5cc5a9b 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1828,7 +1828,11 @@ predicted_ports_prediction_time_remaining(time_t now) if (idle_delta > prediction_timeout) return 0; - return prediction_timeout - idle_delta; + if (BUG((prediction_timeout - idle_delta) > INT_MAX)) { + return INT_MAX; + } + + return (int)(prediction_timeout - idle_delta); } /** We just got an application request for a connection with |