[IOT-2467] Fix issues with cred role 69/21569/3
authorAndrii Shtompel <a.shtompel@samsung.com>
Thu, 20 Jul 2017 14:43:44 +0000 (17:43 +0300)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Thu, 20 Jul 2017 17:48:50 +0000 (17:48 +0000)
Verified with CTT 1.5.12 test CT 1.7.4.2 - PASSED

Change-Id: Iaf734e89d4bf5521814a089145d54702b215324e
Signed-off-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21569
Reviewed-by: Aleksey Volkov <a.volkov@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
resource/csdk/security/src/credresource.c

index 26a7d94..5916277 100644 (file)
@@ -789,7 +789,7 @@ OCStackResult CredToCBORPayload(const OicSecCred_t *credS, uint8_t **cborPayload
 
             bool includeAuthority = (0 != memcmp(&cred->roleId.authority, &EMPTY_ROLE.authority, sizeof(EMPTY_ROLE.authority)));
 
-            cborEncoderResult = cbor_encoder_create_map(&credMap, &roleIdMap, ROLEID_MAP_SIZE + includeAuthority ? 1 : 0);
+            cborEncoderResult = cbor_encoder_create_map(&credMap, &roleIdMap, ROLEID_MAP_SIZE + (includeAuthority ? 1 : 0));
             VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding role ID map");
 
             cborEncoderResult = cbor_encode_text_string(&roleIdMap, OIC_JSON_ROLE_NAME, strlen(OIC_JSON_ROLE_NAME));