]> git.kaiwu.me - nginx.git/commitdiff
SPDY: fixed possible segfault.
authorValentin Bartenev <vbart@nginx.com>
Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)
committerValentin Bartenev <vbart@nginx.com>
Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)
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.

src/http/ngx_http_spdy.c

index 7c93dc49a0773c52776a92dae415c5d7010d8b56..f4f610a82275568c2c3d49e452be99a4d129eb42 100644 (file)
@@ -2626,6 +2626,10 @@ ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc)
         }
     }
 
+    if (sc->stream == stream) {
+        sc->stream = NULL;
+    }
+
     sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
                                         ngx_http_spdy_module);