GCC 8 new warnings in -Wall fix

This commit is contained in:
Sean Parkinson
2018-08-27 11:35:25 +10:00
parent 205088d1bc
commit 551201c00c
3 changed files with 7 additions and 6 deletions

View File

@@ -10391,8 +10391,8 @@ int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn)
ssl->buffers.domainName.length + 1, ssl->heap, DYNAMIC_TYPE_DOMAIN); ssl->buffers.domainName.length + 1, ssl->heap, DYNAMIC_TYPE_DOMAIN);
if (ssl->buffers.domainName.buffer) { if (ssl->buffers.domainName.buffer) {
char* domainName = (char*)ssl->buffers.domainName.buffer; unsigned char* domainName = ssl->buffers.domainName.buffer;
XSTRNCPY(domainName, dn, ssl->buffers.domainName.length); XMEMCPY(domainName, dn, ssl->buffers.domainName.length);
domainName[ssl->buffers.domainName.length] = '\0'; domainName[ssl->buffers.domainName.length] = '\0';
return WOLFSSL_SUCCESS; return WOLFSSL_SUCCESS;
} }

View File

@@ -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 /* Helper function for getting the NID value from md
* *
* returns the NID value associated with md on success */ * returns the NID value associated with md on success */
static int md2nid(int md) static int md2nid(const unsigned char md)
{ {
const char * d; 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 (XSTRNCMP(d, "SHA", 3) == 0) {
if (XSTRLEN(d) > 3) { if (XSTRLEN(d) > 3) {
if (XSTRNCMP(d, "SHA256", 6) == 0) { if (XSTRNCMP(d, "SHA256", 6) == 0) {

View File

@@ -19973,8 +19973,9 @@ int memcb_test(void)
b = NULL; b = NULL;
/* Use API. */ /* Use API. */
if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)&my_Malloc_cb, if (wolfSSL_SetAllocators((wolfSSL_Malloc_cb)(void*)&my_Malloc_cb,
(wolfSSL_Free_cb)&my_Free_cb, (wolfSSL_Realloc_cb)my_Realloc_cb) != 0) { (wolfSSL_Free_cb)(void*)&my_Free_cb,
(wolfSSL_Realloc_cb)(void*)&my_Realloc_cb) != 0) {
ERROR_OUT(-10005, exit_memcb); ERROR_OUT(-10005, exit_memcb);
} }