From 8fe1f562bff0c191d3cdbd24c238b53b547db2df Mon Sep 17 00:00:00 2001 From: mbuhl Date: Tue, 27 Aug 2024 12:38:31 +0200 Subject: [PATCH] ngtcp2/osslq: remove NULL pointer dereferences If data is NULL, then it does not make sense to pass it to failf. Closes #14701 --- lib/vquic/curl_ngtcp2.c | 4 +--- lib/vquic/curl_osslq.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index ee438ee643..675094c288 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -226,10 +226,8 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct cf_ngtcp2_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - if(!data) { - failf(data, "initialization failure, transfer not http initialized"); + if(!data) return CURLE_FAILED_INIT; - } if(stream) return CURLE_OK; diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 157dd9c907..5246db31d6 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -612,10 +612,8 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf, struct cf_osslq_ctx *ctx = cf->ctx; struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data); - if(!data) { - failf(data, "initialization failure, transfer not http initialized"); + if(!data) return CURLE_FAILED_INIT; - } if(stream) return CURLE_OK; -- 2.47.3