diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/set_app_icon_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/set_app_icon_request.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index 5d70a2fb5b..5afddfb4d0 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -71,6 +71,13 @@ void SetAppIconRequest::Run() { const std::string& sync_file_name = (*message_)[strings::msg_params][strings::sync_file_name].asString(); + if (!file_system::IsFileNameValid(sync_file_name)) { + const std::string err_msg = "Sync file name contains forbidden symbols."; + LOG4CXX_ERROR(logger_, err_msg); + SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); + return; + } + std::string full_file_path = application_manager_.get_settings().app_storage_folder() + "/"; full_file_path += app->folder_name(); @@ -113,9 +120,10 @@ void SetAppIconRequest::Run() { void SetAppIconRequest::CopyToIconStorage( const std::string& path_to_file) const { - if (!application_manager_.protocol_handler() - .get_settings() - .enable_protocol_4()) { + if (!(application_manager_.protocol_handler() + .get_settings() + .max_supported_protocol_version() >= + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) { LOG4CXX_WARN(logger_, "Icon copying skipped, since protocol ver. 4 is not enabled."); return; |