From e55ca1a8cf34c0e63c490e52c25a0921e2273ad6 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 17 Jul 2020 10:26:34 -0600 Subject: [PATCH] increase example client key share group array size --- examples/client/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index e4dfbd163..fcab9d5f2 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -230,10 +230,11 @@ static void ShowVersions(void) } #ifdef WOLFSSL_TLS13 +#define MAX_GROUP_NUMBER 4 static void SetKeyShare(WOLFSSL* ssl, int onlyKeyShare, int useX25519, int useX448) { - int groups[3] = {0}; + int groups[MAX_GROUP_NUMBER] = {0}; int count = 0; (void)useX25519; @@ -277,6 +278,8 @@ static void SetKeyShare(WOLFSSL* ssl, int onlyKeyShare, int useX25519, #endif } + if (count >= MAX_GROUP_NUMBER) + err_sys("example group array size error"); if (wolfSSL_set_groups(ssl, groups, count) != WOLFSSL_SUCCESS) err_sys("unable to set groups"); WOLFSSL_END(WC_FUNC_CLIENT_KEY_EXCHANGE_SEND);