Fix segfault due to calling strlen on null payload.
authorMandeep Shetty <mandeep.shetty@intel.com>
Wed, 13 May 2015 18:14:16 +0000 (11:14 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 13 May 2015 21:20:27 +0000 (21:20 +0000)
commit31a52fa6a5778afa0843bb1af7e42e1f3afe5ef6
tree48a73e3c990ba30d665321e96cee27ac51558132
parent7dcd5ffd64d80559d4654df91ea75b7b41c0ed33
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>
resource/csdk/connectivity/src/caprotocolmessage.c