diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-02 02:40:10 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-02 02:40:10 +0100 |
commit | 28d5da5a53b2525488f4ba7b15c4c9f05f2d5a6d (patch) | |
tree | 3f7a324f7c2f1bae8ea31af33b3c8b154fc2393d /pimd | |
parent | pimd: Fix broken switch statement (diff) | |
download | frr-28d5da5a53b2525488f4ba7b15c4c9f05f2d5a6d.tar.xz frr-28d5da5a53b2525488f4ba7b15c4c9f05f2d5a6d.zip |
pimd: Fix cmd issues
Fix possible buffer overwrite and uninitialized idx access.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 7e85253f9..7f276b22c 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -1374,8 +1374,8 @@ pim_show_state(struct vty *vty, const char *src_or_group, const char *group, u_c for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) { char grp_str[INET_ADDRSTRLEN]; char src_str[INET_ADDRSTRLEN]; - char in_ifname[16]; - char out_ifname[16]; + char in_ifname[INTERFACE_NAMSIZ+1]; + char out_ifname[INTERFACE_NAMSIZ+1]; int oif_vif_index; struct interface *ifp_in; first_oif = 1; @@ -3036,8 +3036,8 @@ static void show_mroute(struct vty *vty, u_char uj) for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) { char grp_str[INET_ADDRSTRLEN]; char src_str[INET_ADDRSTRLEN]; - char in_ifname[16]; - char out_ifname[16]; + char in_ifname[INTERFACE_NAMSIZ+1]; + char out_ifname[INTERFACE_NAMSIZ+1]; int oif_vif_index; struct interface *ifp_in; char proto[100]; @@ -4871,7 +4871,7 @@ DEFUN (debug_pim_packets, DEBUG_PIM_J_P_PACKETS_STR DEBUG_PIM_PIM_REG_PACKETS_STR) { - int idx; + int idx = 0; if (argv_find (argv, argc, "hello", &idx)) { PIM_DO_DEBUG_PIM_HELLO; |