mirror of
https://github.com/nginx/nginx.git
synced 2026-06-27 12:21:57 +00:00
Events: fixed null pointer dereference with resolver and poll.
A POLLERR signalled by poll() without POLLIN/POLLOUT, as seen on Linux, would generate both read and write events, but there's no write event handler for resolver events. A fix is to only call event handler of an active event.
This commit is contained in:
parent
db5e48d9b8
commit
33e934ccc8
1 changed files with 2 additions and 2 deletions
|
|
@ -371,7 +371,7 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||
|
||||
found = 0;
|
||||
|
||||
if (revents & POLLIN) {
|
||||
if ((revents & POLLIN) && c->read->active) {
|
||||
found = 1;
|
||||
|
||||
ev = c->read;
|
||||
|
|
@ -388,7 +388,7 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||
ngx_locked_post_event(ev, queue);
|
||||
}
|
||||
|
||||
if (revents & POLLOUT) {
|
||||
if ((revents & POLLOUT) && c->write->active) {
|
||||
found = 1;
|
||||
ev = c->write;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue