From: Valentin Bartenev Date: Wed, 12 Dec 2012 14:48:48 +0000 (+0000) Subject: Limit rate: fixed integer overflow in limit calculation (ticket #256). X-Git-Tag: release-1.3.10~33 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=1a6ed2e3b1f9d995b0e5c1761aa77da474061661;p=nginx.git Limit rate: fixed integer overflow in limit calculation (ticket #256). Patch by Alexey Antropov. --- diff --git a/src/http/ngx_http_write_filter_module.c b/src/http/ngx_http_write_filter_module.c index fd44bc659..5594c7faa 100644 --- a/src/http/ngx_http_write_filter_module.c +++ b/src/http/ngx_http_write_filter_module.c @@ -207,7 +207,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) } 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) {