Nginx: fixbug, stack-buffer-overflow, refer to #286.

This commit is contained in:
chenwei 2018-11-06 12:06:29 +08:00
parent 483c5cf9d1
commit 4c372811c6
1 changed files with 3 additions and 2 deletions

View File

@ -117,12 +117,13 @@ ngx_ff_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
ngx_free(event_list); ngx_free(event_list);
} }
event_list = ngx_alloc(sizeof(struct epoll_event), cycle->log); nevents = 64;
event_list = ngx_alloc(sizeof(struct epoll_event) * nevents, cycle->log);
if (event_list == NULL) { if (event_list == NULL) {
return NGX_ERROR; return NGX_ERROR;
} }
nevents = 8;
return NGX_OK; return NGX_OK;
} }