Diff between bac232e91a8f5e2c90355ee6c20daa5f81787a02 and 8c89636ae69c64e6e60eea3f93496f9c4013a324

Changed Files

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

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 37e4454..fd95400 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -6988,8 +6988,15 @@ static void gatt_srvc_change_write_cb(struct gatt_db_attribute *attrib,
 		return;
 	}
 
+	/* 2 octets are expected as CCC value */
+	if (len != 2) {
+		gatt_db_attribute_write_result(attrib, id,
+						ATT_ECODE_INVAL_ATTR_VALUE_LEN);
+		return;
+	}
+
 	/* Set services changed indication value */
-	bt_store_gatt_ccc(bdaddr, *value);
+	bt_store_gatt_ccc(bdaddr, get_le16(value));
 
 	gatt_db_attribute_write_result(attrib, id, 0);
 }