summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 2dbe907751..447f3dc28d 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2456,11 +2456,12 @@ static void _route_entry_dump_nh(const struct route_entry *re,
switch (nexthop->type) {
case NEXTHOP_TYPE_BLACKHOLE:
- sprintf(nhname, "Blackhole");
+ snprintf(nhname, sizeof(nhname), "Blackhole");
break;
case NEXTHOP_TYPE_IFINDEX:
ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id);
- sprintf(nhname, "%s", ifp ? ifp->name : "Unknown");
+ snprintf(nhname, sizeof(nhname), "%s",
+ ifp ? ifp->name : "Unknown");
break;
case NEXTHOP_TYPE_IPV4:
/* fallthrough */