Fixes for gcc-10 and -fsanitize=undefined for rabbit.c

* One introduced in #4156
* One from previous commit in this PR
This commit is contained in:
Elms
2021-06-30 22:08:29 -07:00
parent 6694775d4b
commit 75e807abc6
3 changed files with 6 additions and 6 deletions

View File

@ -20470,7 +20470,7 @@ int SetCipherList(WOLFSSL_CTX* ctx, Suites* suites, const char* list)
word32 length;
next = XSTRSTR(next, ":");
length = MAX_SUITE_NAME + 1;
length = MAX_SUITE_NAME;
if (next != NULL) {
word32 currLen = (word32)(next - current);
if (length > currLen) {

View File

@ -26312,7 +26312,7 @@ int wolfSSL_X509_VERIFY_PARAM_set1_ip_asc(WOLFSSL_X509_VERIFY_PARAM *param,
param->ipasc[0] = '\0';
}
else {
XSTRNCPY(param->ipasc, ipasc, WOLFSSL_MAX_IPSTR);
XSTRNCPY(param->ipasc, ipasc, WOLFSSL_MAX_IPSTR - 1);
param->ipasc[WOLFSSL_MAX_IPSTR-1] = '\0';
}
ret = WOLFSSL_SUCCESS;

View File

@ -156,10 +156,10 @@ static WC_INLINE int DoKey(Rabbit* ctx, const byte* key, const byte* iv)
word32 k0, k1, k2, k3, i;
/* Generate four subkeys */
k0 = LITTLE32(((word32*)key)[0]);
k1 = LITTLE32(((word32*)key)[1]);
k2 = LITTLE32(((word32*)key)[2]);
k3 = LITTLE32(((word32*)key)[3]);
k0 = LOAD_LE32(key + 0);
k1 = LOAD_LE32(key + 4);
k2 = LOAD_LE32(key + 8);
k3 = LOAD_LE32(key + 12);
/* Generate initial state variables */
ctx->masterCtx.x[0] = k0;