[nginx] SPDY: fixed possible segfault.

Valentin Bartenev vbart at nginx.com
Wed Jan 22 03:10:08 UTC 2014


details:   http://hg.nginx.org/nginx/rev/03c198bb2acf
branches:  
changeset: 5524:03c198bb2acf
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 -r 905841c461fa -r 03c198bb2acf src/http/ngx_http_spdy.c
--- a/src/http/ngx_http_spdy.c	Tue Jan 21 17:39:49 2014 +0400
+++ b/src/http/ngx_http_spdy.c	Wed Jan 22 04:58:19 2014 +0400
@@ -2665,6 +2665,10 @@ ngx_http_spdy_close_stream(ngx_http_spdy
         }
     }
 
+    if (sc->stream == stream) {
+        sc->stream = NULL;
+    }
+
     if (stream->handled) {
         for (s = sc->last_stream; s; s = s->next) {
             if (s->next == stream) {



More information about the nginx-devel mailing list