summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorShwetha Acharya <sacharya@gmail.com>2018-11-21 12:24:00 +0530
committerKotresh HR <khiremat@redhat.com>2018-11-22 04:58:05 +0000
commit429843eb9e3685d11479c58b8bc6416889a01ee3 (patch)
tree2f76ece79fbe9398c6382938cabdf218a70c6433 /cli
parentada43dc22d158dcc8998bb35497f885951b52159 (diff)
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 <sacharya@gmail.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c2
1 files changed, 1 insertions, 1 deletions
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 "