[nginx] svn commit: r5017 - trunk/src/event/modules

ru at nginx.com ru at nginx.com
Fri Jan 25 09:59:29 UTC 2013


Author: ru
Date: 2013-01-25 09:59:28 +0000 (Fri, 25 Jan 2013)
New Revision: 5017
URL: http://trac.nginx.org/nginx/changeset/5017/nginx

Log:
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.


Modified:
   trunk/src/event/modules/ngx_poll_module.c

Modified: trunk/src/event/modules/ngx_poll_module.c
===================================================================
--- trunk/src/event/modules/ngx_poll_module.c	2013-01-24 16:15:51 UTC (rev 5016)
+++ trunk/src/event/modules/ngx_poll_module.c	2013-01-25 09:59:28 UTC (rev 5017)
@@ -371,7 +371,7 @@
 
         found = 0;
 
-        if (revents & POLLIN) {
+        if ((revents & POLLIN) && c->read->active) {
             found = 1;
 
             ev = c->read;
@@ -388,7 +388,7 @@
             ngx_locked_post_event(ev, queue);
         }
 
-        if (revents & POLLOUT) {
+        if ((revents & POLLOUT) && c->write->active) {
             found = 1;
             ev = c->write;
 



More information about the nginx-devel mailing list