From: Wootak Jung Date: Tue, 7 Jul 2020 02:24:14 +0000 (+0900) Subject: Fix input param check logic X-Git-Tag: submit/tizen/20200724.011437~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46ef009ce9f49025be0044c8b8c4a55a6d13e7e0;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fix input param check logic value can be NULL in case of response for write request Change-Id: I553a86747f9661e1a96e8d304e635a0b7cc661b4 Signed-off-by: Wootak Jung --- diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index 33a7464..89c8c7c 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -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; }