From a9294b3a29b0718530bf9ebba550c592310a0730 Mon Sep 17 00:00:00 2001 From: zhangcan42 Date: Mon, 28 Apr 2025 01:58:25 +0000 Subject: [PATCH] fix security Signed-off-by: zhangcan42 --- services/updater_utils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/updater_utils.cpp b/services/updater_utils.cpp index 65995a27..b1af159f 100755 --- a/services/updater_utils.cpp +++ b/services/updater_utils.cpp @@ -48,7 +48,11 @@ void DeleteInstallTimeFile() bool IsDouble(const std::string& str) { std::regex pattern("^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$"); - return std::regex_match(str, pattern); + if (!std::regex_match(str, pattern)) { + LOG(ERROR) << "match double failed"; + return false; + } + return true; } void WriteInstallTime(UpdaterParams &upParams) -- Gitee