bgpd: null chk (Coverity 1433544 1433543 1433542)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
paco 2018-06-18 12:23:28 +02:00
parent 6389e663e9
commit c37a11ad72
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A
3 changed files with 6 additions and 2 deletions

View File

@ -471,7 +471,7 @@ void bgp_info_mpath_update(struct bgp_node *rn, struct bgp_info *new_best,
zlog_debug(
"%s: starting mpath update, newbest %s num candidates %d old-mpath-count %d",
pfx_buf, new_best ? new_best->peer->host : "NONE",
listcount(mp_list), old_mpath_count);
mp_list ? listcount(mp_list) : 0, old_mpath_count);
/*
* We perform an ordered walk through both lists in parallel.

View File

@ -1733,7 +1733,8 @@ void rfapiPrintMatchingDescriptors(struct vty *vty, struct prefix *vn_prefix,
int rfapiCliGetPrefixAddr(struct vty *vty, const char *str, struct prefix *p)
{
if (!str2prefix(str, p)) {
vty_out(vty, "Malformed address \"%s\"%s", str, HVTYNL);
vty_out(vty, "Malformed address \"%s\"%s", str ? str : "null",
HVTYNL);
return CMD_WARNING;
}
switch (p->family) {

View File

@ -1197,6 +1197,9 @@ int str2prefix(const char *str, struct prefix *p)
{
int ret;
if (!str || !p)
return 0;
/* First we try to convert string to struct prefix_ipv4. */
ret = str2prefix_ipv4(str, (struct prefix_ipv4 *)p);
if (ret)