[nginx] SPDY: fixed possible segfault.

Maxim Dounin mdounin at mdounin.ru
Mon Feb 10 13:36:46 UTC 2014


details:   http://hg.nginx.org/nginx/rev/b8e6297358b5
branches:  stable-1.4
changeset: 5565:b8e6297358b5
user:      Valentin Bartenev <vbart at nginx.com>
date:      Wed Jan 22 04:58:19 2014 +0400
description:
SPDY: fixed possible segfault.

While processing a DATA frame, the link to related stream is stored in spdy
connection object as part of connection state.  But this stream can be closed
between receiving parts of the frame.

diffstat:

 src/http/ngx_http_spdy.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -2626,6 +2626,10 @@ ngx_http_spdy_close_stream(ngx_http_spdy
         }
     }
 
+    if (sc->stream == stream) {
+        sc->stream = NULL;
+    }
+
     sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
                                         ngx_http_spdy_module);
 



More information about the nginx-devel mailing list