lib: fix null ptr derefs and uninitialized vars (h2/h3)

Fixing compiler warnings with gcc 13.2.0 in unity builds.

Assisted-by: Jay Satiro
Assisted-by: Stefan Eissing
Closes #11739
This commit is contained in:
Viktor Szakats 2023-08-25 22:28:35 +00:00
parent 51686e0054
commit d50fe6becb
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
4 changed files with 33 additions and 20 deletions

View file

@ -1814,10 +1814,10 @@ out:
}
static ssize_t stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
struct stream_ctx *stream,
char *buf, size_t len, CURLcode *err)
{
struct cf_h2_ctx *ctx = cf->ctx;
struct stream_ctx *stream = H2_STREAM_CTX(data);
ssize_t nread = -1;
*err = CURLE_AGAIN;
@ -1937,7 +1937,7 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
CF_DATA_SAVE(save, cf, data);
nread = stream_recv(cf, data, buf, len, err);
nread = stream_recv(cf, data, stream, buf, len, err);
if(nread < 0 && *err != CURLE_AGAIN)
goto out;
@ -1946,7 +1946,7 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
if(*err)
goto out;
nread = stream_recv(cf, data, buf, len, err);
nread = stream_recv(cf, data, stream, buf, len, err);
}
if(nread > 0) {