mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
support creating new mem bio of length 0
This commit is contained in:
@ -2537,7 +2537,7 @@ int wolfSSL_BIO_flush(WOLFSSL_BIO* bio)
|
||||
len = (int)XSTRLEN((const char*)buf) + 1;
|
||||
}
|
||||
|
||||
if (wolfSSL_BUF_MEM_resize(bio->mem_buf, len) == 0) {
|
||||
if (len > 0 && wolfSSL_BUF_MEM_resize(bio->mem_buf, len) == 0) {
|
||||
wolfSSL_BIO_free(bio);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -39123,6 +39123,9 @@ static void test_wolfSSL_BIO_write(void)
|
||||
BIO_set_retry_read(bio);
|
||||
BIO_free_all(bio); /* frees bio64s also */
|
||||
|
||||
AssertNotNull(bio = BIO_new_mem_buf(out, 0));
|
||||
AssertIntEQ(BIO_write(bio, msg, sizeof(msg)), sizeof(msg));
|
||||
BIO_free(bio);
|
||||
printf(resultFmt, passed);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user