[PATCH BlueZ 2/2] client: Clear ad manufacturer/service data when too much data

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

 



When data is too much, the data may include values not making sense, so
this patch clears the advertising manufacturer/service data corresponding
to the running command.
---
 client/advertising.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/client/advertising.c b/client/advertising.c
index 76eda3c97..e950aa278 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -456,6 +456,7 @@ void ad_advertise_service(DBusConnection *conn, const char *arg)
 
 		if (i >= G_N_ELEMENTS(data->data)) {
 			rl_printf("Too much data\n");
+			ad_clear_service();
 			goto done;
 		}
 
@@ -511,6 +512,7 @@ void ad_advertise_manufacturer(DBusConnection *conn, const char *arg)
 	for (i = 1; i < w.we_wordc; i++) {
 		if (i >= G_N_ELEMENTS(data->data)) {
 			rl_printf("Too much data\n");
+			ad_clear_manufacturer();
 			goto done;
 		}
 
-- 
2.14.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