From: Daniel Stenberg Date: Mon, 17 Jul 2023 18:51:17 +0000 (+0200) Subject: quiche: avoid NULL deref in debug logging X-Git-Tag: curl-8_2_0~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a141c3c08b1bb8db6b51ae00d47898416c48efd9;p=thirdparty%2Fcurl.git quiche: avoid NULL deref in debug logging Coverity reported "Dereference after null check" If stream is NULL and the function exits, the logging must not deref it. Closes #11454 --- diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index d906ebad86..dec97b70db 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -884,8 +884,9 @@ out: if(nread > 0) ctx->data_recvd += nread; DEBUGF(LOG_CF(data, cf, "[h3sid=%"PRId64"] cf_recv(total=%" - CURL_FORMAT_CURL_OFF_T ") -> %zd, %d", - stream->id, ctx->data_recvd, nread, *err)); + CURL_FORMAT_CURL_OFF_T ") -> %zd, %d", + stream ? stream->id : (int64_t)0, + ctx->data_recvd, nread, *err)); return nread; }