Skip to content

Commit

Permalink
If the first remote locator is not located on the embeddedRTPS subnet…
Browse files Browse the repository at this point in the history
…, an incorrect deserialization failure is return, which breaks SPDP (#15)

Co-authored-by: Alexandru Kampmann <[email protected]>
  • Loading branch information
akampmann and Alexandru Kampmann committed May 6, 2022
1 parent 68915c8 commit 1410a87
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions include/rtps/storages/MemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ template <class TYPE, uint32_t SIZE> class MemoryPool {

bool add(const TYPE &data) {
if (isFull()) {
printf("[MemoryPool] RESSOURCE LIMIT EXCEEDED \n");
return false;
}
for (uint8_t bucket = 0; bucket < sizeof(m_bitMap); ++bucket) {
Expand Down
8 changes: 4 additions & 4 deletions src/discovery/ParticipantProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ bool ParticipantProxyData::readLocatorIntoList(
full_length_locator.isMulticastAddress()) {
proxy_locator = LocatorIPv4(full_length_locator);
SPDP_LOG("Adding locator: %u %u %u %u \n",
(int)proxy_locator.address[12], (int)proxy_locator.address[13],
(int)proxy_locator.address[14],
(int)proxy_locator.address[15]);
(int)proxy_locator.address[0], (int)proxy_locator.address[1],
(int)proxy_locator.address[2],
(int)proxy_locator.address[3]);
return true;
} else {
SPDP_LOG("Ignoring locator: %u %u %u %u \n",
(int)full_length_locator.address[12],
(int)full_length_locator.address[13],
(int)full_length_locator.address[14],
(int)full_length_locator.address[15]);
return false;
return true;
}
} else {
valid_locators++;
Expand Down
5 changes: 0 additions & 5 deletions src/messages/MessageTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ bool rtps::deserializeMessage(const MessageProcessingInfo &info,
}

if (msg.readerSNState.numBits != 0) {
if (4 * ((msg.readerSNState.numBits / 32) + 1) >
msg.readerSNState.bitMap.size()) {
while (1)
;
}
doCopyAndMoveOn(
reinterpret_cast<uint8_t *>(msg.readerSNState.bitMap.data()),
currentPos, 4 * ((msg.readerSNState.numBits / 32) + 1));
Expand Down

0 comments on commit 1410a87

Please sign in to comment.