aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2022-01-18 08:52:47 -0500
committerMatthew Smith <mgsmith@netgate.com>2022-01-18 15:28:28 +0000
commit9e0f9e235ad7dafcb481cf25f33eb52fdee8906b (patch)
tree11413a758988394392081c958e66c19b8b195d6c
parent4dc1149cc461dccf91601e8346c6489a2f37b53f (diff)
misc: fix coverity warnings
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I8ea0193ebb2a721a0582451ffd64c4063ac6d233
-rw-r--r--src/vnet/interface_cli.c6
-rw-r--r--src/vpp/app/vppctl.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index b6d38578714..a2dfc2bb3ed 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -2515,6 +2515,12 @@ set_interface_tx_hash_cmd (vlib_main_t *vm, unformat_input_t *input,
goto error;
}
+ if (hash_name == 0)
+ {
+ error = clib_error_return (0, "hash-name is required");
+ goto error;
+ }
+
hi = vnet_get_hw_interface (vnm, hw_if_index);
ftype =
vnet_get_hw_interface_class (vnm, hi->hw_class_index)->tx_hash_fn_type;
diff --git a/src/vpp/app/vppctl.c b/src/vpp/app/vppctl.c
index becab52d08b..c9f33abf7ab 100644
--- a/src/vpp/app/vppctl.c
+++ b/src/vpp/app/vppctl.c
@@ -192,7 +192,7 @@ main (int argc, char *argv[])
struct sockaddr_un saddr = { 0 };
saddr.sun_family = AF_UNIX;
- strncpy (saddr.sun_path, sock_fname, sizeof (saddr.sun_path));
+ strncpy (saddr.sun_path, sock_fname, sizeof (saddr.sun_path) - 1);
sock_fd = socket (AF_UNIX, SOCK_STREAM, 0);
if (sock_fd < 0)