currently, CA don't check the value of CAResponseInfo_t.result.
so I add the logic which CA check whether CAResponseInfo_t.result
is valid value.
This issue is related to IOT-385, IOT-386.
Change-Id: I8fdb7bc021c2b294b068d202a5bd6d5131d1904d
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1133
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: John Light <john.j.light@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
return NULL;
}
+ // check the result value of response info.
+ switch (rep->result)
+ {
+ case CA_EMPTY:
+ case CA_SUCCESS:
+ case CA_CREATED:
+ case CA_DELETED:
+ case CA_BAD_REQ:
+ case CA_BAD_OPT:
+ case CA_NOT_FOUND:
+ case CA_INTERNAL_SERVER_ERROR:
+ case CA_RETRANSMIT_TIMEOUT:
+ break;
+
+ default:
+ OIC_LOG(ERROR, TAG, "Response status code is invalid number");
+ return NULL;
+ }
+
// allocate the response info structure.
CAResponseInfo_t *clone = (CAResponseInfo_t *) OICCalloc(1, sizeof(CAResponseInfo_t));
if (NULL == clone)