Fix segmentation fault

Fix segmentation fault if DATA frame is received for the stream
which is already closed.
This commit is contained in:
Tatsuhiro Tsujikawa 2013-07-31 20:32:44 +09:00
parent ab56cd4ea3
commit bd64619cf5
1 changed files with 2 additions and 1 deletions

View File

@ -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);