if (type == DATACONTROL_TYPE_UNDEFINED || type == DATACONTROL_TYPE_ERROR) {
request_type = bundle_get_val(b, OSP_K_DATACONTROL_REQUEST_TYPE);
if (request_type)
- strncpy(type_str, request_type, MAX_LEN_DATACONTROL_REQ_TYPE);
+ strncpy(type_str, request_type, MAX_LEN_DATACONTROL_REQ_TYPE - 1);
_LOGI("type is %s", type_str);
} else {
}
kb = bundle_decode_raw((bundle_raw *)buf, data_len);
+ if (kb == NULL) {
+ _LOGE("bundle_decode failed");
+ goto error;
+ }
+
if (__provider_process(kb, fd, consumer_appid) !=
DATA_CONTROL_ERROR_NONE) {
bundle_free(kb);