Fixed invalid write in doxmresource
authorErich Keane <erich.keane@intel.com>
Wed, 22 Jul 2015 17:25:48 +0000 (10:25 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 22 Jul 2015 20:01:31 +0000 (20:01 +0000)
The doxmresource was allocating based on the size of a short,
but the type was an enum.  This adjusts the size to be correct.

Change-Id: Id0dcc26b346b2ef096992bd84173319ddce2c7e6
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1819
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/security/src/doxmresource.c

index 310ffe5..83be6fc 100755 (executable)
@@ -214,7 +214,7 @@ OicSecDoxm_t * JSONToDoxmBin(const char * jsonStr)
         doxm->oxmLen = cJSON_GetArraySize(jsonObj);
         VERIFY_SUCCESS(TAG, doxm->oxmLen > 0, ERROR);
 
-        doxm->oxm = (OicSecOxm_t*)OICCalloc(doxm->oxmLen, sizeof(short));
+        doxm->oxm = (OicSecOxm_t*)OICCalloc(doxm->oxmLen, sizeof(OicSecOxm_t));
         VERIFY_NON_NULL(TAG, doxm->oxm, ERROR);
 
         for(int i  = 0; i < doxm->oxmLen ; i++)