Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21638] Be less strict with parameter lengths #5225

Merged
merged 8 commits into from
Sep 19, 2024
38 changes: 19 additions & 19 deletions src/cpp/fastdds/core/policy/ParameterSerializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ inline bool ParameterSerializer<ParameterLocator_t>::read_content_from_cdr_messa
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_LOCATOR_LENGTH)
if (parameter_length < PARAMETER_LOCATOR_LENGTH)
{
return false;
}
Expand All @@ -273,7 +273,7 @@ inline bool ParameterSerializer<ParameterKey_t>::read_content_from_cdr_message(
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KEY_HASH_LENGTH)
if (parameter_length < PARAMETER_KEY_HASH_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -343,7 +343,7 @@ inline bool ParameterSerializer<ParameterPort_t>::read_content_from_cdr_message(
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_PORT_LENGTH)
if (parameter_length < PARAMETER_PORT_LENGTH)
{
return false;
}
Expand All @@ -367,7 +367,7 @@ inline bool ParameterSerializer<ParameterGuid_t>::read_content_from_cdr_message(
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_GUID_LENGTH)
if (parameter_length < PARAMETER_GUID_LENGTH)
{
return false;
}
Expand All @@ -394,7 +394,7 @@ inline bool ParameterSerializer<ParameterProtocolVersion_t>::read_content_from_c
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_PROTOCOL_LENGTH)
if (parameter_length < PARAMETER_PROTOCOL_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -422,7 +422,7 @@ inline bool ParameterSerializer<ParameterVendorId_t>::read_content_from_cdr_mess
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_VENDOR_LENGTH)
if (parameter_length < PARAMETER_VENDOR_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -451,7 +451,7 @@ inline bool ParameterSerializer<ParameterProductVersion_t>::read_content_from_cd
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_PRODUCT_VERSION_LENGTH)
if (parameter_length < PARAMETER_PRODUCT_VERSION_LENGTH)
{
return false;
}
Expand All @@ -477,7 +477,7 @@ inline bool ParameterSerializer<ParameterDomainId_t>::read_content_from_cdr_mess
fastdds::rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_DOMAINID_LENGTH)
if (parameter_length < PARAMETER_DOMAINID_LENGTH)
{
return false;
}
Expand All @@ -499,7 +499,7 @@ inline bool ParameterSerializer<ParameterIP4Address_t>::read_content_from_cdr_me
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_IP4_LENGTH)
if (parameter_length < PARAMETER_IP4_LENGTH)
{
return false;
}
Expand All @@ -525,7 +525,7 @@ inline bool ParameterSerializer<ParameterBool_t>::read_content_from_cdr_message(
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_BOOL_LENGTH)
if (parameter_length < PARAMETER_BOOL_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -553,7 +553,7 @@ inline bool ParameterSerializer<ParameterStatusInfo_t>::read_content_from_cdr_me
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_STATUS_INFO_LENGTH)
if (parameter_length < PARAMETER_STATUS_INFO_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -582,7 +582,7 @@ inline bool ParameterSerializer<ParameterCount_t>::read_content_from_cdr_message
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_COUNT_LENGTH)
if (parameter_length < PARAMETER_COUNT_LENGTH)
{
return false;
}
Expand All @@ -604,7 +604,7 @@ inline bool ParameterSerializer<ParameterEntityId_t>::read_content_from_cdr_mess
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_ENTITYID_LENGTH)
if (parameter_length < PARAMETER_ENTITYID_LENGTH)
{
return false;
}
Expand All @@ -628,7 +628,7 @@ inline bool ParameterSerializer<ParameterTime_t>::read_content_from_cdr_message(
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -656,7 +656,7 @@ inline bool ParameterSerializer<ParameterBuiltinEndpointSet_t>::read_content_fro
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_BUILTINENDPOINTSET_LENGTH)
if (parameter_length < PARAMETER_BUILTINENDPOINTSET_LENGTH)
{
return false;
}
Expand All @@ -678,7 +678,7 @@ inline bool ParameterSerializer<ParameterNetworkConfigSet_t>::read_content_from_
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_NETWORKCONFIGSET_LENGTH)
if (parameter_length < PARAMETER_NETWORKCONFIGSET_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -835,7 +835,7 @@ inline bool ParameterSerializer<ParameterSampleIdentity_t>::read_content_from_cd
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_SAMPLEIDENTITY_LENGTH)
if (parameter_length < PARAMETER_SAMPLEIDENTITY_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -1113,7 +1113,7 @@ inline bool ParameterSerializer<ParameterParticipantSecurityInfo_t>::read_conten
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_PARTICIPANT_SECURITY_INFO_LENGTH)
if (parameter_length < PARAMETER_PARTICIPANT_SECURITY_INFO_LENGTH)
{
return false;
}
Expand All @@ -1139,7 +1139,7 @@ inline bool ParameterSerializer<ParameterEndpointSecurityInfo_t>::read_content_f
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_ENDPOINT_SECURITY_INFO_LENGTH)
if (parameter_length < PARAMETER_ENDPOINT_SECURITY_INFO_LENGTH)
{
return false;
}
Expand Down
32 changes: 16 additions & 16 deletions src/cpp/fastdds/core/policy/QosPoliciesSerializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ inline bool QosPoliciesSerializer<DurabilityQosPolicy>::read_content_from_cdr_me
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH)
if (parameter_length < PARAMETER_KIND_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ inline bool QosPoliciesSerializer<DeadlineQosPolicy>::read_content_from_cdr_mess
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -155,7 +155,7 @@ inline bool QosPoliciesSerializer<LatencyBudgetQosPolicy>::read_content_from_cdr
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ inline bool QosPoliciesSerializer<LivelinessQosPolicy>::read_content_from_cdr_me
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -229,7 +229,7 @@ inline bool QosPoliciesSerializer<ReliabilityQosPolicy>::read_content_from_cdr_m
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_KIND_LENGTH + PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -263,7 +263,7 @@ inline bool QosPoliciesSerializer<OwnershipQosPolicy>::read_content_from_cdr_mes
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH)
if (parameter_length < PARAMETER_KIND_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ inline bool QosPoliciesSerializer<DestinationOrderQosPolicy>::read_content_from_
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH)
if (parameter_length < PARAMETER_KIND_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ inline bool QosPoliciesSerializer<ResourceLimitsQosPolicy>::read_content_from_cd
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != 12)
if (parameter_length < 12)
{
return false;
}
Expand Down Expand Up @@ -357,7 +357,7 @@ inline bool QosPoliciesSerializer<TimeBasedFilterQosPolicy>::read_content_from_c
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_TIME_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -397,7 +397,7 @@ inline bool QosPoliciesSerializer<PresentationQosPolicy>::read_content_from_cdr_
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_PRESENTATION_LENGTH)
if (parameter_length < PARAMETER_PRESENTATION_LENGTH)
{
return false;
}
Expand Down Expand Up @@ -516,7 +516,7 @@ inline bool QosPoliciesSerializer<HistoryQosPolicy>::read_content_from_cdr_messa
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_KIND_LENGTH + 4)
if (parameter_length < PARAMETER_KIND_LENGTH + 4)
{
return false;
}
Expand Down Expand Up @@ -553,7 +553,7 @@ inline bool QosPoliciesSerializer<DurabilityServiceQosPolicy>::read_content_from
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH + PARAMETER_KIND_LENGTH + 16)
if (parameter_length < PARAMETER_TIME_LENGTH + PARAMETER_KIND_LENGTH + 16)
{
return false;
}
Expand Down Expand Up @@ -588,7 +588,7 @@ inline bool QosPoliciesSerializer<LifespanQosPolicy>::read_content_from_cdr_mess
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_TIME_LENGTH)
if (parameter_length < PARAMETER_TIME_LENGTH)
{
return false;
}
Expand All @@ -615,7 +615,7 @@ inline bool QosPoliciesSerializer<OwnershipStrengthQosPolicy>::read_content_from
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != 4)
if (parameter_length < 4)
{
return false;
}
Expand All @@ -638,7 +638,7 @@ inline bool QosPoliciesSerializer<TransportPriorityQosPolicy>::read_content_from
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != 4)
if (parameter_length < 4)
{
return false;
}
Expand Down Expand Up @@ -800,7 +800,7 @@ inline bool QosPoliciesSerializer<DisablePositiveACKsQosPolicy>::read_content_fr
rtps::CDRMessage_t* cdr_message,
const uint16_t parameter_length)
{
if (parameter_length != PARAMETER_BOOL_LENGTH)
if (parameter_length < PARAMETER_BOOL_LENGTH)
{
return false;
}
Expand Down
Loading
Loading