From 46ef009ce9f49025be0044c8b8c4a55a6d13e7e0 Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Tue, 7 Jul 2020 11:24:14 +0900 Subject: [PATCH] Fix input param check logic value can be NULL in case of response for write request Change-Id: I553a86747f9661e1a96e8d304e635a0b7cc661b4 Signed-off-by: Wootak Jung --- src/bluetooth-gatt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.7.4