|
@@ -53,13 +53,18 @@ protected:
|
|
|
|
|
|
// read data from payload
|
|
|
std::size_t size = payload.size();
|
|
|
- uint8_t *data = &payload.front();
|
|
|
- data += size - N;
|
|
|
|
|
|
- BidirectionalChannels<N, PASSIVE>::protocol.receive(data);
|
|
|
+ if (size < N) {
|
|
|
+ std::cerr << __PRETTY_FUNCTION__ << " payload size is too small" << std::endl;
|
|
|
+ } else {
|
|
|
+ uint8_t *data = &payload.front();
|
|
|
+ data += size - N;
|
|
|
|
|
|
- // resize payload
|
|
|
- payload.resize(size - N);
|
|
|
+ BidirectionalChannels<N, PASSIVE>::protocol.receive(data);
|
|
|
+
|
|
|
+ // resize payload
|
|
|
+ payload.resize(size - N);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
BidirectionalChannels<N, PASSIVE>::innerSender.send(pdu);
|