[nginx] svn commit: r4962 - trunk/src/http

vbart at nginx.com vbart at nginx.com
Wed Dec 12 14:48:48 UTC 2012


Author: vbart
Date: 2012-12-12 14:48:48 +0000 (Wed, 12 Dec 2012)
New Revision: 4962
URL: http://trac.nginx.org/nginx/changeset/4962/nginx

Log:
Limit rate: fixed integer overflow in limit calculation (ticket #256).

Patch by Alexey Antropov.



Modified:
   trunk/src/http/ngx_http_write_filter_module.c

Modified: trunk/src/http/ngx_http_write_filter_module.c
===================================================================
--- trunk/src/http/ngx_http_write_filter_module.c	2012-12-12 13:50:07 UTC (rev 4961)
+++ trunk/src/http/ngx_http_write_filter_module.c	2012-12-12 14:48:48 UTC (rev 4962)
@@ -207,7 +207,7 @@
     }
 
     if (r->limit_rate) {
-        limit = r->limit_rate * (ngx_time() - r->start_sec + 1)
+        limit = (off_t) r->limit_rate * (ngx_time() - r->start_sec + 1)
                 - (c->sent - clcf->limit_rate_after);
 
         if (limit <= 0) {



More information about the nginx-devel mailing list