Change-Id: Ib3a04fa87032780368655d08abbc1a58ea8b8faf
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
BT_CHECK_ENABLED_LE(return);
- retv_if(length > 0 && NULL == buf, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(NULL == buf, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(length <= 0 || length > BLUETOOTH_TDS_DATA_LENGTH_MAX,
+ BLUETOOTH_ERROR_INVALID_PARAM);
tds_data.length = length;
memcpy(tds_data.data, buf, length);
int ret;
retv_if(NULL == sender, BLUETOOTH_ERROR_INVALID_PARAM);
- retv_if(len > 0 && NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(NULL == data, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(len <= 0 || len > BLUETOOTH_TDS_DATA_LENGTH_MAX,
+ BLUETOOTH_ERROR_INVALID_PARAM);
BT_DBG("+");