[nginx] svn commit: r5083 - trunk/src/http

vbart at nginx.com vbart at nginx.com
Sat Feb 23 13:23:49 UTC 2013


Author: vbart
Date: 2013-02-23 13:23:48 +0000 (Sat, 23 Feb 2013)
New Revision: 5083
URL: http://trac.nginx.org/nginx/changeset/5083/nginx

Log:
Fixed potential segfault in ngx_http_keepalive_handler().

In case of error in the read event handling we close a connection
by calling ngx_http_close_connection(), that also destroys connection
pool. Thereafter, an attempt to free a buffer (added in r4892) that
was allocated from the pool could cause SIGSEGV and is meaningless
as well (the buffer already freed with the pool).


Modified:
   trunk/src/http/ngx_http_request.c

Modified: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk/src/http/ngx_http_request.c	2013-02-23 11:54:25 UTC (rev 5082)
+++ trunk/src/http/ngx_http_request.c	2013-02-23 13:23:48 UTC (rev 5083)
@@ -2758,6 +2758,7 @@
     if (n == NGX_AGAIN) {
         if (ngx_handle_read_event(rev, 0) != NGX_OK) {
             ngx_http_close_connection(c);
+            return;
         }
 
         /*



More information about the nginx-devel mailing list