[PATCH 2/3] android/gatt: Fix passing out of att range errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Those statuses or errors are of type int and and we need to crop
them to att's range. This fixes potential issues when user app sends
status that is equal or greater than GATT_FAILURE.
---
 android/gatt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 18a5092..b2ce9c1 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -5556,12 +5556,12 @@ static void handle_server_send_response(const void *buf, uint16_t len)
 	if (transaction->opcode < ATT_OP_WRITE_REQ)
 		gatt_db_attribute_read_result(transaction->attrib,
 						transaction->serial_id,
-						cmd->status,
+						err_to_att(cmd->status),
 						cmd->data, cmd->len);
 	else
 		gatt_db_attribute_write_result(transaction->attrib,
 						transaction->serial_id,
-						cmd->status);
+						err_to_att(cmd->status));
 
 	send_dev_complete_response(conn->device, transaction->opcode);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux