]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: CID 1399387 (#1 of 2): Destination buffer too small (STRING_OVERFLOW)
authorMartin Winter <mwinter@opensourcerouting.org>
Fri, 3 Feb 2017 16:05:11 +0000 (23:05 +0700)
committerMartin Winter <mwinter@opensourcerouting.org>
Fri, 10 Feb 2017 09:53:18 +0000 (16:53 +0700)
Coverity: string_overflow: You might overrun the 100-character destination string vty_path by writing 4096 characters from vty_sock_path.
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
ospfd/ospf_main.c

index cc335a8abde9c6f5e4113243107717f22d74ca3c..edb1ca470e71fb17ea043dc6e9ac9953f57cf256 100644 (file)
@@ -407,7 +407,7 @@ main (int argc, char **argv)
     }
   else
     {
-      strcpy(vty_path, vty_sock_path);
+      strlcpy(vty_path, vty_sock_path, sizeof(vty_path));
     }
   vty_serv_sock (vty_addr, vty_port, vty_path);