diff --git a/src/ssl.c b/src/ssl.c index da00d47a0..7d601d565 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -10391,8 +10391,8 @@ int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn) ssl->buffers.domainName.length + 1, ssl->heap, DYNAMIC_TYPE_DOMAIN); if (ssl->buffers.domainName.buffer) { - char* domainName = (char*)ssl->buffers.domainName.buffer; - XSTRNCPY(domainName, dn, ssl->buffers.domainName.length); + unsigned char* domainName = ssl->buffers.domainName.buffer; + XMEMCPY(domainName, dn, ssl->buffers.domainName.length); domainName[ssl->buffers.domainName.length] = '\0'; return WOLFSSL_SUCCESS; } diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index be36a8a88..a2bfaa1d9 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -929,10 +929,10 @@ WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data /* Helper function for getting the NID value from md * * returns the NID value associated with md on success */ -static int md2nid(int md) +static int md2nid(const unsigned char md) { const char * d; - d = (const char *)wolfSSL_EVP_get_md((const unsigned char)md); + d = (const char *)wolfSSL_EVP_get_md(md); if (XSTRNCMP(d, "SHA", 3) == 0) { if (XSTRLEN(d) > 3) { if (XSTRNCMP(d, "SHA256", 6) == 0) { diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index cbe1bbe0e..3cb87f14e 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -19973,8 +19973,9 @@ int memcb_test(void) b = NULL; /* Use API. */ - if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)&my_Malloc_cb, - (wolfSSL_Free_cb)&my_Free_cb, (wolfSSL_Realloc_cb)my_Realloc_cb) != 0) { + if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)(void*)&my_Malloc_cb, + (wolfSSL_Free_cb)(void*)&my_Free_cb, + (wolfSSL_Realloc_cb)(void*)&my_Realloc_cb) != 0) { ERROR_OUT(-10005, exit_memcb); }