Fix input param check logic 60/238560/2
authorWootak Jung <wootak.jung@samsung.com>
Tue, 7 Jul 2020 02:24:14 +0000 (11:24 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 15 Jul 2020 05:32:38 +0000 (14:32 +0900)
value can be NULL in case of response for write request

Change-Id: I553a86747f9661e1a96e8d304e635a0b7cc661b4
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/bluetooth-gatt.c

index 33a7464..89c8c7c 100644 (file)
@@ -3154,10 +3154,11 @@ int bt_gatt_server_send_response(int request_id, bt_gatt_att_request_type_e requ
        int ret = BT_ERROR_NONE;
        BT_CHECK_GATT_SERVER_SUPPORT();
        BT_CHECK_INIT_STATUS();
-       BT_CHECK_INPUT_PARAMETER(value);
 
        if (request_type == BT_GATT_REQUEST_TYPE_READ && /* LCOV_EXCL_START */
                resp_status == BT_ATT_ERROR_NONE) {
+               BT_CHECK_INPUT_PARAMETER(value);
+
                if (value_length < 0)
                        return BT_ERROR_INVALID_PARAMETER;
        }