summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2017-09-06 17:26:46 -0400
committerGitHub <noreply@github.com>2017-09-06 17:26:46 -0400
commit7b067d0e49b42ab4aa584f8fde7051ee4d76de70 (patch)
tree7a40f89bc6637fb611c3a6bdf22c84178fcc4b6d
parent9fe7901605feff7807f5f557a04015bce6258a1a (diff)
parentae2ed9ce91e90de876290b5aba00bc404d8a2169 (diff)
downloadsdl_core-7b067d0e49b42ab4aa584f8fde7051ee4d76de70.tar.gz
Merge pull request #1634 from LitvinenkoIra/fix/SDL_sends_BC.UpdateDeviceList_without_of_upper_bound_size_of_deviceList
Add limitation of size for deviceList in BC.UpdateDeviceList RPC
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 01d180b4b5..65f4c79fa6 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -726,9 +726,12 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
smart_objects::SmartObject(smart_objects::SmartType_Array);
smart_objects::SmartObject& list_so = (*device_list_so)[strings::device_list];
- int32_t index = 0;
+ uint32_t index = 0;
+ // According to requirements, SDL should send info about 100 devices at
+ // maximum, even if SDL has more devices connected.
+ const uint32_t max_device_count = 100;
for (connection_handler::DeviceMap::const_iterator it = devices.begin();
- devices.end() != it;
+ devices.end() != it && index < max_device_count;
++it) {
const connection_handler::Device& d =
static_cast<connection_handler::Device>(it->second);