mirror of
https://github.com/nginx/nginx.git
synced 2025-06-06 00:42:40 +08: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
@ -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…
Reference in New Issue
Block a user