Skip to content

Commit

Permalink
Add NULL termination to payloads
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fallberg committed Feb 7, 2016
1 parent 060de48 commit 5955041
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions libraries/MySensors/MySensor.cpp
Expand Up @@ -620,6 +620,7 @@ boolean MySensor::process() {
if (destination == nc.nodeId) {
// This message is addressed to this node
mSetSigned(msg,0);
msg.data[mGetLength(msg)] = '\0'; // Add NULL termination so that "getters" works as expected

if (repeaterMode && last != nc.parentNodeId) {
// Message is from one of the child nodes. Add it to routing table.
Expand Down
2 changes: 1 addition & 1 deletion libraries/MySensors/Version.h
Expand Up @@ -6,6 +6,6 @@
#ifndef Version_h
#define Version_h

#define LIBRARY_VERSION "1.5.3"
#define LIBRARY_VERSION "1.5.4"

#endif

0 comments on commit 5955041

Please sign in to comment.