From 2887eedb3ef5b3c66a29e236479a384d9505358a Mon Sep 17 00:00:00 2001 From: Vibhav Pant Date: Tue, 29 Aug 2023 14:02:44 +0530 Subject: [PATCH] profile_object_path: Ensure the object name is valid. --- internal/platform/implementation/linux/bluez.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/platform/implementation/linux/bluez.cc b/internal/platform/implementation/linux/bluez.cc index 736a6c49..426ff73d 100644 --- a/internal/platform/implementation/linux/bluez.cc +++ b/internal/platform/implementation/linux/bluez.cc @@ -14,7 +14,8 @@ std::string device_object_path(const sdbus::ObjectPath &adapter_object_path, } sdbus::ObjectPath profile_object_path(absl::string_view service_uuid) { - return absl::Substitute("/com/google/nearby/profiles/$0", service_uuid); + return absl::Substitute("/com/google/nearby/profiles/$0", + absl::StrReplaceAll(service_uuid, {{"-", "_"}})); } sdbus::ObjectPath adapter_object_path(absl::string_view name) {