]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: don't use strcpy
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 Apr 2020 23:56:49 +0000 (19:56 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 Apr 2020 23:59:02 +0000 (19:59 -0400)
>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
pimd/pim_mlag.c
pimd/pim_rp.c

index 47735475f3f58ab32788b9961215c84ece645d0c..78be914cee0ba23dcb5ec9f690713e07d0080939 100644 (file)
@@ -583,7 +583,9 @@ static void pim_mlag_process_mlagd_state_change(struct mlag_status msg)
                router->mlag_role = msg.my_role;
        }
 
-       strcpy(router->peerlink_rif, msg.peerlink_rif);
+       strlcpy(router->peerlink_rif, msg.peerlink_rif,
+               sizeof(router->peerlink_rif));
+
        /* XXX - handle the case where we may rx the interface name from the
         * MLAG daemon before we get the interface from zebra.
         */
index a9f1d9335a0d38d5b68d999414aab2a7a971d684..ef5f478226f3618290b9a78c9b3fdf4810e17e7f 100644 (file)
@@ -1261,11 +1261,11 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
                        char buf[48];
 
                        if (rp_info->rp_src == RP_SRC_STATIC)
-                               strcpy(source, "Static");
+                               strlcpy(source, "Static", sizeof(source));
                        else if (rp_info->rp_src == RP_SRC_BSR)
-                               strcpy(source, "BSR");
+                               strlcpy(source, "BSR", sizeof(source));
                        else
-                               strcpy(source, "None");
+                               strlcpy(source, "None", sizeof(source));
                        if (uj) {
                                /*
                                 * If we have moved on to a new RP then add the