From 429843eb9e3685d11479c58b8bc6416889a01ee3 Mon Sep 17 00:00:00 2001 From: Shwetha Acharya Date: Wed, 21 Nov 2018 12:24:00 +0530 Subject: geo-rep: validate the config checkpoint date format Added a strlen check to ensure that the format is (Y-m-d H:M:S). Change-Id: I8844aaa33418d43ffe2320c4a05eb1eddd306903 updates: bz#1651584 Signed-off-by: Shwetha Acharya --- cli/src/cli-cmd-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/src') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index c6d6232b638..94deb9125a2 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2724,7 +2724,7 @@ config_parse(const char **words, int wordcount, dict_t *dict, unsigned cmdi, ret_chkpt = strptime(append_str, "%Y-%m-%d %H:%M:%S", &checkpoint_time); - if (ret_chkpt == NULL) { + if (ret_chkpt == NULL || *ret_chkpt != '\0') { ret = -1; cli_err( "Invalid Checkpoint label. Use format " -- cgit