From bd64619cf56314452e0aa111e46424cf75fbb4e5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 31 Jul 2013 20:32:44 +0900 Subject: [PATCH] Fix segmentation fault Fix segmentation fault if DATA frame is received for the stream which is already closed. --- lib/nghttp2_session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 4ecc5260..15981044 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -2738,7 +2738,8 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, (data_flags & NGHTTP2_FLAG_END_STREAM) == 0)) { nghttp2_stream *stream; stream = nghttp2_session_get_stream(session, data_stream_id); - if(session->local_flow_control || stream->local_flow_control) { + if(session->local_flow_control || + (stream && stream->local_flow_control)) { r = nghttp2_session_update_recv_window_size(session, stream, readlen);