summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-05-04 02:02:53 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-05-03 11:05:19 +0200
commit964c3dba62d7532957f7ea20a82c0afb4c8b3de2 (patch)
tree65063a95155d6752f95daabc792f3a30d1c5123c /pbrd
parentMerge pull request #4233 from qlyoung/fix-zapi-msg-debugs (diff)
downloadfrr-964c3dba62d7532957f7ea20a82c0afb4c8b3de2.tar.xz
frr-964c3dba62d7532957f7ea20a82c0afb4c8b3de2.zip
pbrd: Prevent usage of c if it is null
It is possible, that a connected lookup from zebra_interface_address_read is null. Protect and Serve Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_zebra.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 4f8f50556..1396d83d6 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -111,8 +111,9 @@ static int interface_address_add(int command, struct zclient *zclient,
c = zebra_interface_address_read(command, zclient->ibuf, vrf_id);
DEBUGD(&pbr_dbg_zebra,
- "%s: %s added %s", __PRETTY_FUNCTION__, c->ifp->name,
- prefix2str(c->address, buf, sizeof(buf)));
+ "%s: %s added %s", __PRETTY_FUNCTION__,
+ c ? c->ifp->name : "Unknown",
+ c ? prefix2str(c->address, buf, sizeof(buf)) : "Unknown");
return 0;
}