From 4c372811c6dc6284e804052de4631520976012bd Mon Sep 17 00:00:00 2001 From: chenwei Date: Tue, 6 Nov 2018 12:06:29 +0800 Subject: [PATCH] Nginx: fixbug, stack-buffer-overflow, refer to #286. --- .../src/event/modules/ngx_ff_host_event_module.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/nginx-1.11.10/src/event/modules/ngx_ff_host_event_module.c b/app/nginx-1.11.10/src/event/modules/ngx_ff_host_event_module.c index ac5e3f837..5a8527565 100644 --- a/app/nginx-1.11.10/src/event/modules/ngx_ff_host_event_module.c +++ b/app/nginx-1.11.10/src/event/modules/ngx_ff_host_event_module.c @@ -117,12 +117,13 @@ ngx_ff_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer) 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) { return NGX_ERROR; } - nevents = 8; return NGX_OK; }