Fixes for Coverity issues

This commit is contained in:
Mark Riddoch 2014-11-19 16:01:38 +00:00
parent c2655e048c
commit 0e6fa09d7e
2 changed files with 8 additions and 2 deletions

View File

@ -363,7 +363,7 @@ unsigned char encrypted[80];
return NULL;
memset(padded_passwd, 0, 80);
strcpy((char *)padded_passwd, password);
strncpy((char *)padded_passwd, password, 80);
padded_len = ((strlen(password) / AES_BLOCK_SIZE) + 1) * AES_BLOCK_SIZE;
AES_set_encrypt_key(keys->enckey, 8 * MAXSCALE_KEYLEN, &aeskey);

View File

@ -356,7 +356,13 @@ int rc;
}
// socket options
setsockopt(listener->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one));
if (setsockopt(listener->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)))
{
LOGIF(LE, (skygw_log_write(
LOGFILE_ERROR,
"Unable to set SO_REUSEADDR on maxscale listener."
)));
}
// set NONBLOCKING mode
setnonblocking(listener->fd);
// bind address and port