Harden parsing of CBOR to ensure types are accurate
authorThiago Macieira <thiago.macieira@intel.com>
Wed, 11 Jan 2017 06:42:03 +0000 (22:42 -0800)
committerAshok Babu Channa <ashok.channa@samsung.com>
Wed, 1 Feb 2017 11:48:29 +0000 (11:48 +0000)
commit878de88800221d6dc8f58f81924ac0ac5f0fd6d2
tree4f5e74907713494d3590fdf87ec3ac872f0e067d
parent32771c9e29e37149a4836ce50143e3a5706d6f75
Harden parsing of CBOR to ensure types are accurate

TinyCBOR requires that the caller ensure that the type of the entry
pointed by CborValue be of the correct type before extracting the
value. Otherwise, bad things happen (failed assertions in debug mode).

This fixes IOT-1722.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I2bc52f3c7a574209b213fffd1498a48851c9c5d8
Reviewed-on: https://gerrit.iotivity.org/gerrit/16309
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: byonggon chun <bg.chun@samsung.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/stack/src/ocpayloadparse.c