security: fix reading of permission attribute from configuration
authorHauke Mehrtens <hauke.mehrtens@intel.com>
Fri, 17 Jun 2016 15:38:35 +0000 (17:38 +0200)
committerRandeep Singh <randeep.s@samsung.com>
Tue, 21 Jun 2016 05:16:30 +0000 (05:16 +0000)
commit1a60514ef5d7c9a4f276ed8f99137997ef7667b9
tree0d37af7c153da2762a56a72569b968b2808f9d06
parent8c771da50f4d30bdafaecf8fc7810661903c4236
security: fix reading of permission attribute from configuration

Casting the pointer to the permission attribute from uint16_t to uint64_t
causes problems on MIPS Big Endian systems and probably othrs as well.
When the calling method interprets it as uint64_t not the value is
converted but the pointer is interpreted as it would point to a 64 bit
integer, but it is only a 16 bit wide integer. On MIPS BE permission was
always 0 independent of which value between 0 and 32 the permission
attribute had, this was probably written to some padding area or into
some other member of the struct.

This patch fixes the memory corruption and makes the code work for me with
a MIPS BE CPU.

Change-Id: Ifa843e69980ad4309b1e3076b8e2c98c03324352
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8755
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/aclresource.c