From 639f73fe1f5786ddea2cb63b63769dec601850a9 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 21 Jul 2020 13:40:56 -0700 Subject: [PATCH] Fix for client writes to not include the null term. --- examples/client/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index df0bb6b9a..eefd9a41a 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -3132,11 +3132,11 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) if (sendGET) { printf("SSL connect ok, sending GET...\n"); - msgSz = (int)sizeof(kHttpGetMsg) - 1; /* no null term */ + msgSz = (int)XSTRLEN(kHttpGetMsg); XMEMCPY(msg, kHttpGetMsg, msgSz); } else { - msgSz = (int)sizeof(kHelloMsg); + msgSz = (int)XSTRLEN(kHelloMsg); XMEMCPY(msg, kHelloMsg, msgSz); } @@ -3419,7 +3419,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) } #endif /* HAVE_SECURE_RENEGOTIATION */ - (void)ClientWrite(sslResume, kResumeMsg, (int)sizeof(kResumeMsg), + (void)ClientWrite(sslResume, kResumeMsg, (int)XSTRLEN(kResumeMsg), " resume", 0); (void)ClientRead(sslResume, reply, sizeof(reply)-1, sendGET,