From 157273fb40d4ea8ef3947395e8e69f5ae2057c23 Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Tue, 30 Oct 2018 11:38:59 +0200 Subject: [PATCH 1/2] Check if exists regex expression --- src/rpc/cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index a95ff2f..f3ff507 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -210,7 +210,7 @@ static int cli_completion(char *token, char ***array) */ static int cli_check_secret(const char *source) { - if (boost::regex_match(source, cli_regex_secret())) + if (nullptr != cli_regex_secret().expression() && boost::regex_match(source, cli_regex_secret())) return 1; return 0; From 079de9e17799db87980057b26ec96a0fda88f86c Mon Sep 17 00:00:00 2001 From: Valera Cogut Date: Tue, 30 Oct 2018 22:05:31 +0200 Subject: [PATCH 2/2] Check if boost::regex is empty --- src/rpc/cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index f3ff507..d106253 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -210,7 +210,7 @@ static int cli_completion(char *token, char ***array) */ static int cli_check_secret(const char *source) { - if (nullptr != cli_regex_secret().expression() && boost::regex_match(source, cli_regex_secret())) + if (!cli_regex_secret().empty() && boost::regex_match(source, cli_regex_secret())) return 1; return 0;