Merge pull request #1067 from JacobBarthelmeh/Memory

sanity check on index when adding cipher suites
This commit is contained in:
toddouska
2017-07-31 12:03:49 -07:00
committed by GitHub

View File

@@ -15785,6 +15785,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