Unverified Commit 78d5302b authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

http2: abort the send_callback if not setup yet

When Curl_http2_done() gets called before the http2 data is setup all
the way, we cannot send anything and this should just return an error.

Detected by OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10012
parent 396fc084
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -370,6 +370,10 @@ static ssize_t send_callback(nghttp2_session *h2,
  (void)h2;
  (void)flags;

  if(!c->send_underlying)
    /* called before setup properly! */
    return NGHTTP2_ERR_CALLBACK_FAILURE;

  written = ((Curl_send*)c->send_underlying)(conn, FIRSTSOCKET,
                                             data, length, &result);