From 964c3dba62d7532957f7ea20a82c0afb4c8b3de2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 3 May 2019 20:02:53 -0400 Subject: [PATCH] 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 --- pbrd/pbr_zebra.c | 5 +++-- 1 file 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; } -- 2.39.5