diff --git a/source/src/cip/cipcommon.c b/source/src/cip/cipcommon.c index 62f9b4d18..8e680e980 100644 --- a/source/src/cip/cipcommon.c +++ b/source/src/cip/cipcommon.c @@ -1378,8 +1378,10 @@ void EncodeEPath(const CipEpath *const epath, } } + /* path size is in 16 bit chunks according to the specification */ OPENER_ASSERT( - epath->path_size * 2 == message->used_message_length - start_length); /* path size is in 16 bit chunks according to the specification */ + epath->path_size * sizeof(CipWord) == + message->used_message_length - start_length); } int DecodePaddedEPath(CipEpath *epath, diff --git a/source/src/cip/cipconnectionmanager.c b/source/src/cip/cipconnectionmanager.c index e5609bcc1..44cbe0b38 100644 --- a/source/src/cip/cipconnectionmanager.c +++ b/source/src/cip/cipconnectionmanager.c @@ -1352,14 +1352,14 @@ EipUint8 ParseConnectionPath(CipConnectionObject *connection_object, header_length = g_kLargeForwardOpenHeaderLength; } - if( (header_length + remaining_path * 2) < + if( ( header_length + remaining_path * sizeof(CipWord) ) < message_router_request->request_data_size ) { /* the received packet is larger than the data in the path */ *extended_error = 0; return kCipErrorTooMuchData; } - if( (header_length + remaining_path * 2) > + if( ( header_length + remaining_path * sizeof(CipWord) ) > message_router_request->request_data_size ) { /*there is not enough data in received packet */ *extended_error = 0;