Don't allow the invalid ADV handle 13/269313/1 accepted/tizen/6.5/unified/20220117.134844 submit/tizen_6.5/20220112.235917
authordh79pyun <dh79.pyun@samsung.com>
Wed, 12 Jan 2022 23:40:52 +0000 (08:40 +0900)
committerdh79pyun <dh79.pyun@samsung.com>
Wed, 12 Jan 2022 23:58:23 +0000 (08:58 +0900)
Change-Id: Ieca085a04733bcfdc69d028d9fde8205d21f1c67
Signed-off-by: dh79pyun <dh79.pyun@samsung.com>
bt-api/bt-adapter-le.c

index e4f80cd..efd8ef6 100644 (file)
@@ -321,6 +321,11 @@ BT_EXPORT_API int bluetooth_set_advertising_data(int handle, const bluetooth_adv
        BT_CHECK_PARAMETER(value, return);
        BT_CHECK_ENABLED_ANY(return);
 
+       if (handle == 0) {
+               BT_ERR("Invalid handle value: %d", handle);
+               return BLUETOOTH_ERROR_INVALID_PARAM;
+       }
+
        if (length > BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - 3)
                return BLUETOOTH_ERROR_INVALID_PARAM;