diff --git a/src/mms/iso_cotp/cotp.c b/src/mms/iso_cotp/cotp.c index f57e05bc..bec87729 100644 --- a/src/mms/iso_cotp/cotp.c +++ b/src/mms/iso_cotp/cotp.c @@ -466,9 +466,14 @@ parseOptions(CotpConnection* self, uint8_t* buffer, int bufLen) if (optionLen < 5) { self->options.tSelDst.size = optionLen; + const uint8_t TransportSelectorConstValue[4] = {0,1,0,0}; int i; for (i = 0; i < optionLen; i++) + { self->options.tSelDst.value[i] = buffer[bufPos++]; + if(TransportSelectorConstValue[i] != self->options.tSelDst.value[i]) + return false; + } } else goto cpo_error; diff --git a/src/mms/iso_presentation/iso_presentation.c b/src/mms/iso_presentation/iso_presentation.c index c4f2f64e..f54909ad 100644 --- a/src/mms/iso_presentation/iso_presentation.c +++ b/src/mms/iso_presentation/iso_presentation.c @@ -447,9 +447,14 @@ parseNormalModeParameters(IsoPresentation* self, uint8_t* buffer, int totalLengt } else { self->calledPresentationSelector.size = len; + const uint8_t PresentationSelectorConstValue[16] = {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0}; int i; for (i = 0; i < len; i++) + { self->calledPresentationSelector.value[i] = buffer[bufPos + i]; + if(PresentationSelectorConstValue[i] != self->calledPresentationSelector.value[i]) + return -1; + } } bufPos += len; diff --git a/src/mms/iso_session/iso_session.c b/src/mms/iso_session/iso_session.c index e41cbedd..c3486c7c 100644 --- a/src/mms/iso_session/iso_session.c +++ b/src/mms/iso_session/iso_session.c @@ -187,9 +187,14 @@ parseSessionHeaderParameters(IsoSession* session, ByteBuffer* message, int param { session->calledSessionSelector.size = parameterLength; + const uint8_t SessionSelectorConstValue[16] = {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int i; for (i = 0; i < session->calledSessionSelector.size; i++) + { session->calledSessionSelector.value[i] = message->buffer[offset++]; + if(SessionSelectorConstValue[i] != session->calledSessionSelector.value[i]) + return SESSION_ERROR; + } } break;