Fixed missing null terminator in mpm_sample_client
authorGeorge Nash <george.nash@intel.com>
Tue, 4 Apr 2017 22:00:04 +0000 (15:00 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Thu, 6 Apr 2017 18:31:26 +0000 (18:31 +0000)
commitf7681434ada0a1a795ca8246d628b606d88f481d
treecb35545d41fefd9c7744a7e13f4ffc975458a6c5
parent99a12144fe3cea90eece1a1b6da564299d3a430c
Fixed missing null terminator in mpm_sample_client

The string in contained in the MPMMessage passed to the onCallback
funtion may not be null terminated.

This is accounted for when creating the message_char variable but
the message_char variable was not used when MPMAddDevice was called
causing a non-terminated string to be passed to the to the plugin.

Using the message_char variable with size+1 solved the missing null
terminated string issue.

Change-Id: If760cc77fba9fe46b191b3c5a7ec2abac9da63ac
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18491
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Todd Malsbary <todd.malsbary@intel.com>
bridging/mpm_client/MPMSampleClient.cpp