diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4e8a0c3cf7..36200de6fa 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -200,7 +200,7 @@ static int mbedtls_bio_cf_read(void *bio, unsigned char *buf, size_t blen) { struct Curl_cfilter *cf = bio; struct Curl_easy *data = CF_DATA_CURRENT(cf); - size_t nread; + size_t nread = 0; CURLcode result; DEBUGASSERT(data); @@ -215,6 +215,7 @@ static int mbedtls_bio_cf_read(void *bio, unsigned char *buf, size_t blen) blen, result, nread); if(CURLE_AGAIN == result) return MBEDTLS_ERR_SSL_WANT_READ; + /* nread is never larger than int here */ return result ? -1 : (int)nread; }