sanity check before copy with new memory bio

This commit is contained in:
JacobBarthelmeh
2022-03-30 14:02:03 -07:00
parent a914d782c0
commit 8136c55a39

View File

@@ -2545,7 +2545,9 @@ int wolfSSL_BIO_flush(WOLFSSL_BIO* bio)
bio->num = (int)bio->mem_buf->max;
bio->wrSz = len;
bio->ptr = bio->mem_buf->data;
XMEMCPY(bio->ptr, buf, len);
if (len > 0 && bio->ptr != NULL) {
XMEMCPY(bio->ptr, buf, len);
}
return bio;
}