From 45d005874e5a7aeec9c3057e5db407ab84f16145 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Mon, 13 Aug 2018 14:52:21 -0700 Subject: [PATCH] vtysh: Fix missing tailing / in --config_dir option parsing Signed-off-by: Martin Winter --- vtysh/vtysh_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c index 7d882620e8..86fa62f474 100644 --- a/vtysh/vtysh_main.c +++ b/vtysh/vtysh_main.c @@ -356,7 +356,7 @@ int main(int argc, char **argv, char **env) break; case OPTION_CONFDIR: ditch_suid = 1; /* option disables SUID */ - strlcpy(sysconfdir, optarg, sizeof(sysconfdir)); + snprintf(sysconfdir, sizeof(sysconfdir), "%s/", optarg); break; case 'N': if (strchr(optarg, '/') || strchr(optarg, '.')) { -- 2.39.5