Fix for client writes to not include the null term.

This commit is contained in:
David Garske
2020-07-21 13:40:56 -07:00
parent 4e637ddf10
commit 639f73fe1f

View File

@@ -3132,11 +3132,11 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
if (sendGET) { if (sendGET) {
printf("SSL connect ok, sending GET...\n"); printf("SSL connect ok, sending GET...\n");
msgSz = (int)sizeof(kHttpGetMsg) - 1; /* no null term */ msgSz = (int)XSTRLEN(kHttpGetMsg);
XMEMCPY(msg, kHttpGetMsg, msgSz); XMEMCPY(msg, kHttpGetMsg, msgSz);
} }
else { else {
msgSz = (int)sizeof(kHelloMsg); msgSz = (int)XSTRLEN(kHelloMsg);
XMEMCPY(msg, kHelloMsg, msgSz); XMEMCPY(msg, kHelloMsg, msgSz);
} }
@@ -3419,7 +3419,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
} }
#endif /* HAVE_SECURE_RENEGOTIATION */ #endif /* HAVE_SECURE_RENEGOTIATION */
(void)ClientWrite(sslResume, kResumeMsg, (int)sizeof(kResumeMsg), (void)ClientWrite(sslResume, kResumeMsg, (int)XSTRLEN(kResumeMsg),
" resume", 0); " resume", 0);
(void)ClientRead(sslResume, reply, sizeof(reply)-1, sendGET, (void)ClientRead(sslResume, reply, sizeof(reply)-1, sendGET,