From 0d59aea93f9ba7dfbd5b153ddae95cc0b083394a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 17 Jul 2023 20:23:22 +0200 Subject: [PATCH] ngtcp2: assigning timeout, but value is overwritten before used Reported by Coverity Closes #11453 --- lib/vquic/curl_ngtcp2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 5db9df57ac..1d68fc0f1a 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1000,7 +1000,6 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, struct cf_ngtcp2_ctx *ctx = cf->ctx; struct pkt_io_ctx local_pktx; ngtcp2_tstamp expiry; - ngtcp2_duration timeout; if(!pktx) { pktx_init(&local_pktx, cf, data); @@ -1021,7 +1020,6 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0); return CURLE_SEND_ERROR; } - timeout = 0; result = cf_progress_ingress(cf, data, pktx); if(result) return result; @@ -1033,7 +1031,7 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, } if(expiry > pktx->ts) { - timeout = expiry - pktx->ts; + ngtcp2_duration timeout = expiry - pktx->ts; if(timeout % NGTCP2_MILLISECONDS) { timeout += NGTCP2_MILLISECONDS; }