Merge pull request #2492 from pacovn/cppcheck_security1

eigrpd, lib, tests, vtysh: security (cppcheck)
This commit is contained in:
Russ White 2018-06-19 07:14:19 -04:00 committed by GitHub
commit aa13697bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View File

@ -757,7 +757,6 @@ static void eigrp_update_send_GR_part(struct eigrp_neighbor *nbr)
prefixes = nbr->nbr_gr_prefixes_send;
send_prefixes = 0;
length = EIGRP_HEADER_LEN;
/* if there already were last packet chunk, we won't continue */
if (nbr->nbr_gr_packet_type == EIGRP_PACKET_PART_LAST)

View File

@ -174,9 +174,10 @@ int funcname_frrzmq_thread_add_read(struct thread_master *master,
cb = *cbp;
else {
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
cb->write.cancelled = 1;
if (!cb)
return -1;
cb->write.cancelled = 1;
*cbp = cb;
}
@ -282,9 +283,10 @@ int funcname_frrzmq_thread_add_write(struct thread_master *master,
cb = *cbp;
else {
cb = XCALLOC(MTYPE_ZEROMQ_CB, sizeof(struct frrzmq_cb));
cb->read.cancelled = 1;
if (!cb)
return -1;
cb->read.cancelled = 1;
*cbp = cb;
}

View File

@ -104,9 +104,7 @@ static unsigned int log_key(void *data)
static int log_cmp(const void *a, const void *b)
{
if (a == NULL && b != NULL)
return 0;
if (b == NULL && a != NULL)
if (a == NULL || b == NULL)
return 0;
return !memcmp(a, b, 2 * sizeof(struct prefix));

View File

@ -816,7 +816,7 @@ int vtysh_mark_file(const char *filename)
vty_out(vty, "%s", vty->buf);
break;
case CMD_SUCCESS_DAEMON: {
int cmd_stat = CMD_SUCCESS;
int cmd_stat;
vty_out(vty, "%s", vty->buf);
cmd_stat = vtysh_client_execute(&vtysh_client[0],