From ad8f74b6506dc3fc185287c5c7ba9462e61fb9e5 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 19 Dec 2024 16:13:07 -0600 Subject: [PATCH] examples/client/client.c and examples/client/client.c: use XSTRLCPY() to assure proper null termination. --- examples/client/client.c | 2 +- examples/server/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index c72ea728af..ca47164020 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -2391,7 +2391,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("provided connection ID is too big"); } else { - strncpy(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE-1); + XSTRLCPY(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE); } } break; diff --git a/examples/server/server.c b/examples/server/server.c index 95a106d702..2b72a1de9b 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -2411,7 +2411,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args) err_sys("provided connection ID is too big"); } else { - strncpy(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE-1); + XSTRLCPY(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE); } } break;