summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorSho Amano <samano@xevo.com>2018-05-17 12:05:06 +0900
committerSho Amano <samano@xevo.com>2018-06-26 20:03:26 +0900
commit47fad359d4e3cbed9aec2162616dff9b11506213 (patch)
tree8b20354f42a28be156541e4a1c9a45f12efc4c56 /src/components
parenta79341d7a35b7d97e239d4908a34b72978d5a821 (diff)
downloadsdl_core-47fad359d4e3cbed9aec2162616dff9b11506213.tar.gz
fix: invalid memory access in Policy Manager when HMI level is invalid
Diffstat (limited to 'src/components')
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 67658c2809..d49f4e3af9 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -1527,6 +1527,13 @@ void PolicyHandler::CheckPermissions(
POLICY_LIB_CHECK_VOID();
const std::string hmi_level =
MessageHelper::StringifiedHMILevel(app->hmi_level());
+ if (hmi_level.empty()) {
+ LOG4CXX_WARN(logger_,
+ "HMI level for " << app->policy_app_id() << " is invalid, rpc "
+ << rpc << " is not allowed.");
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ return;
+ }
const std::string device_id = MessageHelper::GetDeviceMacAddressForHandle(
app->device(), application_manager_);
LOG4CXX_INFO(logger_,