aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_aio_write_chain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_aio_write_chain.c')
-rw-r--r--src/os/unix/ngx_aio_write_chain.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os/unix/ngx_aio_write_chain.c b/src/os/unix/ngx_aio_write_chain.c
index 4d45f079a..c1109dc12 100644
--- a/src/os/unix/ngx_aio_write_chain.c
+++ b/src/os/unix/ngx_aio_write_chain.c
@@ -20,6 +20,12 @@ ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
ngx_err_t err;
ngx_chain_t *cl;
+ /* the maximum limit size is the maximum size_t value - the page size */
+
+ if (limit == 0 || limit > MAX_SIZE_T_VALUE - ngx_pagesize) {
+ limit = MAX_SIZE_T_VALUE - ngx_pagesize;
+ }
+
send = 0;
sent = 0;
cl = in;