summaryrefslogtreecommitdiff
path: root/pbrd/pbr_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-05-03 20:02:53 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-05-03 05:05:19 -0400
commit964c3dba62d7532957f7ea20a82c0afb4c8b3de2 (patch)
tree65063a95155d6752f95daabc792f3a30d1c5123c /pbrd/pbr_zebra.c
parentb1ad7351a51a921b2a4424550268bbf1d4238f24 (diff)
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/pbr_zebra.c')
-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 4f8f50556b..1396d83d65 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;
}