From aead408d2d07421f2c5dc12d2c0fb317695f3b7d Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Thu, 26 Nov 2020 11:51:55 +0900 Subject: [PATCH] Add wgt package version policy If given version string is not start with allowed pattern, GetPackageVersion() will return empty string. This patch will check its result and fails entire install procedure if so. Change-Id: I14ebc962f0dd7167b9d166a4844960744216fc9b Signed-off-by: Junghyun Yeon --- src/wgt/step/configuration/step_parse.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc index 8c97c72..d4c677b 100644 --- a/src/wgt/step/configuration/step_parse.cc +++ b/src/wgt/step/configuration/step_parse.cc @@ -249,7 +249,12 @@ bool StepParse::FillWidgetInfo(manifest_x* manifest) { const std::string& version = wgt_info->version(); manifest->ns = strdup(kTizenPackageXmlNamespace); - manifest->version = strdup(GetPackageVersion(version).c_str()); + std::string version_tmp = GetPackageVersion(version); + if (version_tmp.empty()) { + LOG(ERROR) << "Invalid version format : " << version; + return false; + } + manifest->version = strdup(version_tmp.c_str()); for (auto& item : wgt_info->description_set()) { description_x* description = reinterpret_cast -- 2.7.4