[nginx] svn commit: r5063 - in branches/stable-1.2: . src/event/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Feb 11 16:06:40 UTC 2013


Author: mdounin
Date: 2013-02-11 16:06:39 +0000 (Mon, 11 Feb 2013)
New Revision: 5063
URL: http://trac.nginx.org/nginx/changeset/5063/nginx

Log:
Merge of r5017: fixed null dereference with resolver and poll.

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:
   branches/stable-1.2/
   branches/stable-1.2/src/event/modules/ngx_poll_module.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2013-02-11 15:34:30 UTC (rev 5062)
+++ branches/stable-1.2	2013-02-11 16:06:39 UTC (rev 5063)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5004,5011-5016,5019-5025,5030
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5004,5011-5017,5019-5025,5030
\ No newline at end of property
Modified: branches/stable-1.2/src/event/modules/ngx_poll_module.c
===================================================================
--- branches/stable-1.2/src/event/modules/ngx_poll_module.c	2013-02-11 15:34:30 UTC (rev 5062)
+++ branches/stable-1.2/src/event/modules/ngx_poll_module.c	2013-02-11 16:06:39 UTC (rev 5063)
@@ -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