Fix crash when discovering devices & platforms.
authorMandeep Shetty <mandeep.shetty@intel.com>
Thu, 24 Sep 2015 21:52:23 +0000 (14:52 -0700)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Mon, 28 Sep 2015 16:45:20 +0000 (16:45 +0000)
commitfc8b820ca26a587f79ac1855cae2be21dd1bd3fc
treeba6ad89b3b3c61ffc2422abe293f0f15ef464a52
parent9ef0b6d82f55f51af8b24eab01712eed3eecfcfc
Fix crash when discovering devices & platforms.

This fixes IOT-714

Iotivity does not currently enforce the mandatory fields of device and
platform be set by applications.
As a result, servers that do NOT set device and platform info segfault
when encoding device and platform info into CBOR as CBOR expects the
fields to be present.

Modified cbor payload to work with NULL fields in device and platform
payloads.

This changed also needs to go into 1.0.0-dev.

Change-Id: Ia626422bd441069febd47a5f44dd12aa42b1d46e
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3059
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
(cherry picked from commit bf098fcea98bcc7a8ccd490a512f8aee320bcce7)
Reviewed-on: https://gerrit.iotivity.org/gerrit/3127
resource/csdk/stack/src/ocpayloadconvert.c
resource/csdk/stack/src/ocpayloadparse.c