nghttpx: Check null just in case

This commit is contained in:
Tatsuhiro Tsujikawa 2016-05-22 21:57:24 +09:00
parent 944297df28
commit 65135bc319
1 changed files with 5 additions and 0 deletions

View File

@ -1385,6 +1385,11 @@ int send_data_callback(nghttp2_session *session, nghttp2_frame *frame,
auto http2session = static_cast<Http2Session *>(user_data); auto http2session = static_cast<Http2Session *>(user_data);
auto sd = static_cast<StreamData *>( auto sd = static_cast<StreamData *>(
nghttp2_session_get_stream_user_data(session, frame->hd.stream_id)); nghttp2_session_get_stream_user_data(session, frame->hd.stream_id));
if (sd == nullptr) {
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
auto dconn = sd->dconn; auto dconn = sd->dconn;
auto downstream = dconn->get_downstream(); auto downstream = dconn->get_downstream();
auto input = downstream->get_request_buf(); auto input = downstream->get_request_buf();