Skip to content

Commit 5955041

Browse files
committed
Add NULL termination to payloads
Messages addressed to "this" node, will have a null char appended to the payload after message verification is done, because some "getters" assume the message being a string.
1 parent 060de48 commit 5955041

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

libraries/MySensors/MySensor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ boolean MySensor::process() {
620620
if (destination == nc.nodeId) {
621621
// This message is addressed to this node
622622
mSetSigned(msg,0);
623+
msg.data[mGetLength(msg)] = '\0'; // Add NULL termination so that "getters" works as expected
623624

624625
if (repeaterMode && last != nc.parentNodeId) {
625626
// Message is from one of the child nodes. Add it to routing table.

libraries/MySensors/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
#ifndef Version_h
77
#define Version_h
88

9-
#define LIBRARY_VERSION "1.5.3"
9+
#define LIBRARY_VERSION "1.5.4"
1010

1111
#endif

0 commit comments

Comments
 (0)