diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c index 6eb1e39884..884c5aa51a 100644 --- a/bgpd/bgp_flowspec.c +++ b/bgpd/bgp_flowspec.c @@ -148,7 +148,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr, if (BGP_DEBUG(flowspec, FLOWSPEC)) { char return_string[BGP_FLOWSPEC_NLRI_STRING_MAX]; - char local_string[BGP_FLOWSPEC_NLRI_STRING_MAX]; + char local_string[BGP_FLOWSPEC_NLRI_STRING_MAX * 2]; char ec_string[BGP_FLOWSPEC_NLRI_STRING_MAX]; char *s = NULL; @@ -157,20 +157,19 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr, p.u.prefix_flowspec.prefixlen, return_string, NLRI_STRING_FORMAT_MIN, NULL); - snprintf(ec_string, BGP_FLOWSPEC_NLRI_STRING_MAX, + snprintf(ec_string, sizeof(ec_string), "EC{none}"); if (attr && attr->ecommunity) { s = ecommunity_ecom2str(attr->ecommunity, ECOMMUNITY_FORMAT_ROUTE_MAP, 0); - snprintf(ec_string, - BGP_FLOWSPEC_NLRI_STRING_MAX, + snprintf(ec_string, sizeof(ec_string), "EC{%s}", s == NULL ? "none" : s); if (s) ecommunity_strfree(&s); } - snprintf(local_string, BGP_FLOWSPEC_NLRI_STRING_MAX, + snprintf(local_string, sizeof(local_string), "FS Rx %s %s %s %s", withdraw ? "Withdraw":"Update", afi2str(afi), return_string, diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 0e99bcbb14..a60543cabe 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7063,8 +7063,8 @@ void route_vty_out_tag(struct vty *vty, struct prefix *p, || (safi == SAFI_EVPN && BGP_ATTR_NEXTHOP_AFI_IP6(attr)) || (BGP_ATTR_NEXTHOP_AFI_IP6(attr))) { - char buf_a[BUFSIZ]; - char buf_b[BUFSIZ]; + char buf_a[512]; + char buf_b[512]; char buf_c[BUFSIZ]; if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL) { @@ -11421,7 +11421,7 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp, struct prefix *p; struct prefix_rd *prd; struct bgp_static *bgp_static; - char buf[PREFIX_STRLEN]; + char buf[PREFIX_STRLEN * 2]; char buf2[SU_ADDRSTRLEN]; char rdbuf[RD_ADDRSTRLEN]; diff --git a/lib/libfrr.c b/lib/libfrr.c index 9931183634..88203fbeb6 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -47,9 +47,9 @@ const char frr_moduledir[] = MODULE_PATH; char frr_protoname[256] = "NONE"; char frr_protonameinst[256] = "NONE"; -char config_default[256]; +char config_default[512]; char frr_zclientpath[256]; -static char pidfile_default[256]; +static char pidfile_default[512]; static char vtypath_default[256]; bool debug_memstats_at_exit = 0; diff --git a/lib/libfrr.h b/lib/libfrr.h index fe6c46670a..7ffa780bfb 100644 --- a/lib/libfrr.h +++ b/lib/libfrr.h @@ -113,7 +113,7 @@ extern void frr_early_fini(void); DECLARE_KOOH(frr_fini, (), ()) extern void frr_fini(void); -extern char config_default[256]; +extern char config_default[512]; extern char frr_zclientpath[256]; extern const char frr_sysconfdir[]; extern const char frr_vtydir[]; diff --git a/lib/module.c b/lib/module.c index 3f13307d82..0c85364003 100644 --- a/lib/module.c +++ b/lib/module.c @@ -75,7 +75,7 @@ struct frrmod_runtime *frrmod_load(const char *spec, const char *dir, char *err, size_t err_len) { void *handle = NULL; - char name[PATH_MAX], fullpath[PATH_MAX], *args; + char name[PATH_MAX], fullpath[PATH_MAX * 2], *args; struct frrmod_runtime *rtinfo, **rtinfop; const struct frrmod_info *info; diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 0c4926edbb..840683cc2f 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -35,7 +35,7 @@ extern unsigned char conf_debug_ospf6_neighbor; /* Neighbor structure */ struct ospf6_neighbor { /* Neighbor Router ID String */ - char name[32]; + char name[36]; /* OSPFv3 Interface this neighbor belongs to */ struct ospf6_interface *ospf6_if; diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index ff5e6bb784..ad7d072d3d 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -52,8 +52,8 @@ static gid_t elevgid, realgid; #define FRR_CONFIG_NAME "frr.conf" /* Configuration file name and directory. */ -static char vtysh_config[MAXPATHLEN]; -char frr_config[MAXPATHLEN]; +static char vtysh_config[MAXPATHLEN * 3]; +char frr_config[MAXPATHLEN * 3]; char vtydir[MAXPATHLEN]; static char history_file[MAXPATHLEN];