diff --git a/src/bio.c b/src/bio.c index 3b76b5ec1e..38484309dd 100644 --- a/src/bio.c +++ b/src/bio.c @@ -608,7 +608,7 @@ static int wolfSSL_BIO_MEMORY_write(WOLFSSL_BIO* bio, const void* data, if (len == 0) return WOLFSSL_SUCCESS; /* Return early to make logic simpler */ - if (wolfSSL_BUF_MEM_grow_ex(bio->mem_buf, (size_t)(bio->wrSz + len), 0) + if (wolfSSL_BUF_MEM_grow_ex(bio->mem_buf, bio->wrSz + len, 0) == 0) { WOLFSSL_MSG("Error growing memory area"); return WOLFSSL_FAILURE; @@ -1320,7 +1320,7 @@ size_t wolfSSL_BIO_ctrl_pending(WOLFSSL_BIO *bio) if (pair->wrIdx > 0 && pair->wrIdx <= pair->rdIdx) { /* in wrap around state where beginning of buffer is being * overwritten */ - return (size_t)(pair->wrSz - pair->rdIdx + pair->wrIdx); + return pair->wrSz - pair->rdIdx + pair->wrIdx; } else { /* simple case where has not wrapped around */