]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/mtracebis.c
pimd: Prevent Null string %s issues
[mirror_frr.git] / pimd / mtracebis.c
index 65c495eff04502a6f0ca35e74be2d362f4d0aa30..1b812de92c72068729406af6f29a397b07d4032e 100644 (file)
@@ -17,9 +17,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <zebra.h>
 
 #ifdef __linux__
 
@@ -110,7 +108,7 @@ static const char *rtg_proto_str(enum mtrace_rtg_proto proto)
        case MTRACE_RTG_PROTO_PIM_ASSERT:
                return "PIM assert";
        default:
-               sprintf(buf, "unknown protocol (%d)", proto);
+               snprintf(buf, sizeof(buf), "unknown protocol (%d)", proto);
                return buf;
        }
 }
@@ -163,7 +161,7 @@ static const char *fwd_code_str(enum mtrace_fwd_code code)
        case MTRACE_FWD_CODE_ADMIN_PROHIB:
                return "admin. prohib.";
        default:
-               sprintf(buf, "unknown fwd. code (%d)", code);
+               snprintf(buf, sizeof(buf), "unknown fwd. code (%d)", code);
                return buf;
        }
 }
@@ -450,7 +448,7 @@ int main(int argc, char *const argv[])
                exit(EXIT_FAILURE);
        }
 
-       mc_group.s_addr = 0;
+       mc_group.s_addr = INADDR_ANY;
        not_group = false;
 
        if (argc == 3) {