Skip to content

Commit

Permalink
msg_t: ensure proper termination of pszRawMsg
Browse files Browse the repository at this point in the history
MsgSetRawMsg() always enforces termination by a zero
byte. MsgSetRawMsgSize() is used in SanitizeMsg() in a way that
suggests zero-temination.  Amend MsgSetRawMsgSize() to be consistent
with the semantics of MsgSetRawMsg().
  • Loading branch information
theinric committed Jun 8, 2015
1 parent 3739e6c commit f7a6bf7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions runtime/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ MsgSetRawMsgSize(msg_t *pMsg, size_t newLen)
{
assert(newLen <= (size_t) pMsg->iLenRawMsg);
pMsg->iLenRawMsg = newLen;
pMsg->pszRawMsg[newLen] = '\0';
}

static inline void
Expand Down

0 comments on commit f7a6bf7

Please sign in to comment.