Merge pull request #5002 from JacobBarthelmeh/Compatibility-Layer

sanity check before copy with new memory bio
This commit is contained in:
Daniel Pouzzner
2022-03-31 15:08:26 -05:00
committed by GitHub

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