Apply tizen 3.0 based product patchsets
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-tds.c
index c7b983b..f54696c 100644 (file)
@@ -140,7 +140,9 @@ BT_EXPORT_API int bluetooth_set_tds_provider_transport_data(unsigned int tds_han
 
        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);