From cfed7a279d511d4a5a7700ef6f6d589cb5d34295 Mon Sep 17 00:00:00 2001 From: tekka007 Date: Thu, 31 Dec 2015 17:03:40 +0100 Subject: [PATCH] General limitation of msg length to MAX_PAYLOAD correction --- libraries/MySensors/core/MyTransport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/MySensors/core/MyTransport.cpp b/libraries/MySensors/core/MyTransport.cpp index 57391b7..4c3e796 100644 --- a/libraries/MySensors/core/MyTransport.cpp +++ b/libraries/MySensors/core/MyTransport.cpp @@ -140,7 +140,7 @@ inline void transportProcess() { // This message is addressed to this node mSetSigned(_msg,0); // Clear the sign-flag now as verification is completed // prevent buffer overflow by limiting max. possible message length (5 bits=31 bytes max) to MAX_PAYLOAD (25 bytes) - mSetLength(_msg) = min(mGetLength(_msg),MAX_PAYLOAD); + mSetLength(_msg, min(mGetLength(_msg),MAX_PAYLOAD)); // null terminate data _msg.data[mGetLength(_msg)] = 0x00;