mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +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;
|
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);
|
wolfSSL_BIO_free(bio);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -39123,6 +39123,9 @@ static void test_wolfSSL_BIO_write(void)
|
|||||||
BIO_set_retry_read(bio);
|
BIO_set_retry_read(bio);
|
||||||
BIO_free_all(bio); /* frees bio64s also */
|
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);
|
printf(resultFmt, passed);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user