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
This commit is contained in:
Daniel Stenberg 2023-07-17 20:51:17 +02:00
parent 380fe02cf5
commit a141c3c08b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;
}