Skip to content

Commit cfed7a2

Browse files
committed
General limitation of msg length to MAX_PAYLOAD correction
1 parent 6d1c609 commit cfed7a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/MySensors/core/MyTransport.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ inline void transportProcess() {
140140
// This message is addressed to this node
141141
mSetSigned(_msg,0); // Clear the sign-flag now as verification is completed
142142
// prevent buffer overflow by limiting max. possible message length (5 bits=31 bytes max) to MAX_PAYLOAD (25 bytes)
143-
mSetLength(_msg) = min(mGetLength(_msg),MAX_PAYLOAD);
143+
mSetLength(_msg, min(mGetLength(_msg),MAX_PAYLOAD));
144144
// null terminate data
145145
_msg.data[mGetLength(_msg)] = 0x00;
146146

0 commit comments

Comments
 (0)