Skip to content

Commit 1823123

Browse files
Fix potential length mismatch in non realloc case in wolfSSL_BIO_set_conn_hostname.
Thanks to Cal Page for the report.
1 parent 0c9b639 commit 1823123

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,7 @@ int wolfSSL_BIO_flush(WOLFSSL_BIO* bio)
28492849
tmp = b->ip;
28502850
b->ip = (char*)XMALLOC(newLen+1, b->heap, DYNAMIC_TYPE_OPENSSL);
28512851
if (b->ip != NULL && tmp != NULL) {
2852-
XMEMCPY(b->ip, tmp, newLen);
2852+
XMEMCPY(b->ip, tmp, currLen < newLen : currLen ? newLen);
28532853
XFREE(tmp, b->heap, DYNAMIC_TYPE_OPENSSL);
28542854
tmp = NULL;
28552855
}

0 commit comments

Comments
 (0)