Diff between b91e19db94358a8ccd0654c5acecf1aaaf14b628 and c5966b25c1f2f5fb22cfaf37c2a85daea1d0f65e

Changed Files

File Additions Deletions Status
android/gatt.c +8 -3 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 2ee2d05..cccf23e 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4884,9 +4884,14 @@ static void handle_server_send_indication(const void *buf, uint16_t len)
 						(uint8_t *)cmd->value, cmd->len,
 						pdu, mtu);
 
-	g_attrib_send(conn->device->attrib, 0, pdu, length, NULL, NULL, NULL);
-
-	status = HAL_STATUS_SUCCESS;
+	if (length == 0) {
+		error("gatt: Failed to encode indication");
+		status = HAL_STATUS_FAILED;
+	} else {
+		g_attrib_send(conn->device->attrib, 0, pdu, length, NULL, NULL,
+									NULL);
+		status = HAL_STATUS_SUCCESS;
+	}
 
 reply:
 	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT,