]> git.kaiwu.me - nginx.git/commitdiff
Fixed segfault with poll and resolver used.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 18 Jun 2012 14:10:50 +0000 (14:10 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 18 Jun 2012 14:10:50 +0000 (14:10 +0000)
Poll event method needs ngx_cycle->files to work, and use of ngx_exit_cycle
without files set caused null pointer dereference in resolver's cleanup
on udp socket close.

src/os/unix/ngx_process_cycle.c

index 82cf8e6caa5af61ecedf16238935074ab468f51c..0474a26ca725110870816bf3b976be556efa6ed0 100644 (file)
@@ -711,6 +711,8 @@ ngx_master_process_exit(ngx_cycle_t *cycle)
     ngx_exit_log.file = &ngx_exit_log_file;
 
     ngx_exit_cycle.log = &ngx_exit_log;
+    ngx_exit_cycle.files = ngx_cycle->files;
+    ngx_exit_cycle.files_n = ngx_cycle->files_n;
     ngx_cycle = &ngx_exit_cycle;
 
     ngx_destroy_pool(cycle->pool);
@@ -1054,6 +1056,8 @@ ngx_worker_process_exit(ngx_cycle_t *cycle)
     ngx_exit_log.file = &ngx_exit_log_file;
 
     ngx_exit_cycle.log = &ngx_exit_log;
+    ngx_exit_cycle.files = ngx_cycle->files;
+    ngx_exit_cycle.files_n = ngx_cycle->files_n;
     ngx_cycle = &ngx_exit_cycle;
 
     ngx_destroy_pool(cycle->pool);