aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-08-27 10:28:20 -0700
committerWayne Davison <wayned@samba.org>2011-08-27 12:05:07 -0700
commit18749579b57e5b2f3ab2050c88bf2750686be246 (patch)
tree0c35d646d7b16d683978d76ba7ebe418f5707da5 /io.c
parenta05758fde647e1d1b36446ca09afbb9433799920 (diff)
downloadandroid_external_rsync-18749579b57e5b2f3ab2050c88bf2750686be246.tar.gz
android_external_rsync-18749579b57e5b2f3ab2050c88bf2750686be246.tar.bz2
android_external_rsync-18749579b57e5b2f3ab2050c88bf2750686be246.zip
Fix bwlimit multiplication overflow. Fixes bug 8375.
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 4fb78aab..7cb3be13 100644
--- a/io.c
+++ b/io.c
@@ -1936,7 +1936,7 @@ static void sleep_for_bwlimit(int bytes_written)
if (prior_tv.tv_sec) {
elapsed_usec = (start_tv.tv_sec - prior_tv.tv_sec) * ONE_SEC
+ (start_tv.tv_usec - prior_tv.tv_usec);
- total_written -= elapsed_usec * bwlimit / (ONE_SEC/1024);
+ total_written -= (int64)elapsed_usec * bwlimit / (ONE_SEC/1024);
if (total_written < 0)
total_written = 0;
}