summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-04-11 09:22:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-11 12:29:03 +0200
commit452b8e39ef3afce717395404bb9d62d497d3f5f6 (patch)
tree4e40dae53872159faf49874e3f211c3ab24881c8 /lib/http2.c
parent309a517ffd923b722509adfcb75ab554d1c34a73 (diff)
downloadcurl-452b8e39ef3afce717395404bb9d62d497d3f5f6.tar.gz
http2: avoid possible null pointer dereference
Reported-by: Dan Fandrich Fixes #10920 Closes #10923
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 3c9d0a014..127ae4394 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -219,13 +219,15 @@ static CURLcode http2_data_setup(struct Curl_cfilter *cf,
struct stream_ctx **pstream)
{
struct cf_h2_ctx *ctx = cf->ctx;
- struct stream_ctx *stream = H2_STREAM_CTX(data);
+ struct stream_ctx *stream;
(void)cf;
+ DEBUGASSERT(data);
if(!data->req.p.http) {
failf(data, "initialization failure, transfer not http initialized");
return CURLE_FAILED_INIT;
}
+ stream = H2_STREAM_CTX(data);
if(stream) {
*pstream = stream;
return CURLE_OK;