From: Daniel Stenberg Date: Mon, 20 Aug 2018 11:19:08 +0000 (+0200) Subject: http2: avoid set_stream_user_data() before stream is assigned X-Git-Tag: curl-7_61_1~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e29ff2be2f4ae0dace025672e0289104d58adb2a;p=thirdparty%2Fcurl.git http2: avoid set_stream_user_data() before stream is assigned ... before the stream is started, we have it set to -1. Fixes #2894 Closes #2898 --- diff --git a/lib/http2.c b/lib/http2.c index 9380ca7cf6..350642019d 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1178,7 +1178,8 @@ void Curl_http2_done(struct connectdata *conn, bool premature) httpc->pause_stream_id = 0; } } - if(http->stream_id) { + /* -1 means unassigned and 0 means cleared */ + if(http->stream_id > 0) { int rv = nghttp2_session_set_stream_user_data(httpc->h2, http->stream_id, 0); if(rv) {