From bafb3e4a5baed06fd36295f1054f07302d8d9969 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 12 Jan 2005 12:19:00 +0000 Subject: [PATCH] fix another integer underflow caused by buckets going negative svn:r3346 --- src/or/connection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/or/connection.c b/src/or/connection.c index 8df204ff7f..459542e32c 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -729,6 +729,8 @@ static int connection_bucket_read_limit(connection_t *conn) { if (at_most > conn->receiver_bucket) at_most = conn->receiver_bucket; + if (at_most < 0) + return 0; return at_most; }