diff --git a/adapter/uhdf2/hdi/src/hdi_support.cpp b/adapter/uhdf2/hdi/src/hdi_support.cpp index febe1f6198d243302245355530b1e4aec5ee5162..f9d75701762685690db958aa3b093037d4abffdb 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; }