[PATCH v2 BlueZ] adapter: Fix segfault when icon is uninitialized

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

 



If device type is LE and GAP Appearance characteristic does not exist,
the icon will not be initialized.
---
 src/adapter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index f8f46f8..6afeaad 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2710,6 +2710,8 @@ void adapter_emit_device_found(struct btd_adapter *adapter,
 		if (read_remote_appearance(&adapter->bdaddr, &dev->bdaddr,
 								&app) == 0)
 			icon = gap_appearance_to_icon(app);
+		else
+			icon = NULL;
 
 		emit_device_found(adapter->path, paddr,
 				"Address", DBUS_TYPE_STRING, &paddr,
-- 
1.7.5.4

--
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