Fix segfault on GET for device and platform info.
authorMandeep Shetty <mandeep.shetty@intel.com>
Tue, 16 Jun 2015 17:11:13 +0000 (10:11 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 17 Jun 2015 15:48:57 +0000 (15:48 +0000)
commit7544b239e4efa9f2cc6b05f1eee96444808089a1
tree53cb5be1bb266d08a0b9de4f6927bc79b94aba61
parent430911e7f8ba36aa38269e50655c901b662089c4
Fix segfault on GET for device and platform info.

The mandatory fields for device and platform are not enforced by the
stack on init. They are enforced only when the info is explicitly added.
Servers that did not register this device and platform info segfaulted
when getting discovery requests from clients.
Added a null check before dereferencing a pointer to fix the problem.

Change-Id: I8b77d149014329e60f8aa8e9c1efb761394487da
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1285
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/src/ocresource.c