Fix SVACE issue 183840 03/123103/2
authorAtul Rai <a.rai@samsung.com>
Tue, 4 Apr 2017 10:25:16 +0000 (15:55 +0530)
committerAtul Rai <a.rai@samsung.com>
Wed, 5 Apr 2017 03:38:07 +0000 (20:38 -0700)
This patch amends the upper limit for TDS buffer length,
while checking for Out of range values.

Change-Id: I9f4581e14a6a03be2864c8b431dc53a01a835231
Signed-off-by: Atul Rai <a.rai@samsung.com>
src/bluetooth-tds.c

index 51e36918c18ea2be23ebab94a8c2068ccd777d2f..6252d91a1e4a36e2a4f97ca0c1a677d637837ee4 100644 (file)
@@ -239,7 +239,7 @@ int bt_tds_provider_set_transport_data(bt_tds_provider_h provider,
        if (!tds_provider_registered)
                return BT_ERROR_NOT_INITIALIZED;
 
-       if (255 < length) {
+       if (BLUETOOTH_TDS_DATA_LENGTH_MAX < length) {
                error_code = BT_ERROR_INVALID_PARAMETER;
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
                return error_code;