sanity check on index when adding cipher suites

This commit is contained in:
Jacob Barthelmeh
2017-07-28 17:42:52 -06:00
parent bc72d0c2d5
commit 5564be6113

View File

@@ -15783,6 +15783,11 @@ int SetCipherList(WOLFSSL_CTX* ctx, Suites* suites, const char* list)
}
#endif /* WOLFSSL_DTLS */
if (idx + 1 >= WOLFSSL_MAX_SUITE_SZ) {
WOLFSSL_MSG("WOLFSSL_MAX_SUITE_SZ set too low");
return 0; /* suites buffer not large enough, error out */
}
suites->suites[idx++] = (XSTRSTR(name, "TLS13")) ? TLS13_BYTE
: (XSTRSTR(name, "CHACHA")) ? CHACHA_BYTE
: (XSTRSTR(name, "QSH")) ? QSH_BYTE