Fix segfault due to calling strlen on null payload.
Some messages like ACKs, RESETs and others have null payload.
strlen was called in the function args which caused a seg fault.
Added check for null before calling strlen and moved call outside of
args list.
Change-Id: Ia97d48e662c220f73eec56bd260ed1f6c94dab90
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/979
Reviewed-by: Erich Keane <erich.keane@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>