[PATCH BlueZ v2 3/9] advertising: parse_secondary: check for NULL iterator

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

 



The passed iterator can be NULL as in
gdbus/client.c::properties_changed():
...
   proxy->prop_func(..., ..., iter=NULL, ...)
   +--src/advertising.c::properties_changed(..., ..., iter, ...);
      +--parse_secondary(iter, ...);
...
---
 src/advertising.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/advertising.c b/src/advertising.c
index 42ac627604fe..6d8d06edd34f 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1047,6 +1047,12 @@ static bool parse_secondary(DBusMessageIter *iter,
 	const char *str;
 	struct adv_secondary *sec;
 
+	if (!iter) {
+		/* Reset secondary channels */
+		client->flags &= ~MGMT_ADV_FLAG_SEC_MASK;
+		return true;
+	}
+
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING)
 		return false;
 
-- 
2.35.3




[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