From b2f8bb6a152e3b1d430e67a218544c71c69fef40 Mon Sep 17 00:00:00 2001 From: huyx Date: Tue, 8 Apr 2025 16:47:31 +0800 Subject: [PATCH] code check clean Signed-off-by: huyx --- adapter/uhdf2/hdi/src/hdi_support.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adapter/uhdf2/hdi/src/hdi_support.cpp b/adapter/uhdf2/hdi/src/hdi_support.cpp index febe1f619..f9d757017 100644 --- a/adapter/uhdf2/hdi/src/hdi_support.cpp +++ b/adapter/uhdf2/hdi/src/hdi_support.cpp @@ -99,7 +99,12 @@ static int32_t ParseInterface( const std::string &desc, std::string &interface, std::string &libName, const char *serviceName) { std::smatch result; - if (!std::regex_match(desc, result, REINFDESC)) { + try { + if (!std::regex_match(desc, result, REINFDESC)) { + return HDF_FAILURE; + } + } catch (const std::regex_error &e) { + HDF_LOGE("%{public}s regex_match has exception", __func__); return HDF_FAILURE; } -- Gitee