Skip to content

Commit

Permalink
More fixes to the RemLengthMemberField adapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jun 19, 2024
1 parent fc6ee74 commit 9ea82aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/comms/field/adapter/RemLengthMemberField.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ class RemLengthMemberField : public TBase

static const std::size_t NextIdx = (TFromIdx <= TLenFieldIdx) ? TLenFieldIdx + 1 : TFromIdx;

if ((std::tuple_size<ValueType>::value <= TUntilIdx) &&
(len < reqLen)) {
return comms::ErrorStatus::NotEnoughData;
}

auto remLen = std::min(len, reqLen);
es = BaseImpl::template readFromUntilAndUpdateLen<NextIdx, TUntilIdx>(iter, remLen);
auto consumed = reqLen - remLen;
Expand Down

0 comments on commit 9ea82aa

Please sign in to comment.