summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-20 21:19:26 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-04-06 19:22:43 +0200
commitf1c3fe1b44bb43ac8491f09f2b4f3af265a1829d (patch)
treef7013cdeb8d20330de83a8ee92d6f05e33a7c7d5 /pbrd
parentpbrd: Only allow one nexthop group or nexthop at a time (diff)
downloadfrr-f1c3fe1b44bb43ac8491f09f2b4f3af265a1829d.tar.xz
frr-f1c3fe1b44bb43ac8491f09f2b4f3af265a1829d.zip
pbrd: fix null pointer deref when showing ifaces
If there are no PBR interfaces configured and we do a 'show run', pbrd crashes with a NPD when it tries to dereference ifp->info. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_map.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index 8e4d52cbc..f3ecc5882 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -161,7 +161,8 @@ void pbr_map_write_interfaces(struct vty *vty, struct interface *ifp)
{
struct pbr_interface *pbr_ifp = ifp->info;
- if (!(strcmp(pbr_ifp->mapname, "") == 0))
+ if (pbr_ifp
+ && strncmp(pbr_ifp->mapname, "", sizeof(pbr_ifp->mapname)) != 0)
vty_out(vty, " pbr-policy %s\n", pbr_ifp->mapname);
}