From 09b287e98fab38f9c6e9e76e185d5662d9a14a6c Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 18 Jan 2017 15:25:14 +0100 Subject: winrt: Fixed null ptr access in LE device discovery For some devices DeviceInformation is null. These cases should not lead to a crash so we just ignore these devices. Change-Id: I9f55b6931c9790b4bdfe217fd506229d2125b78b Reviewed-by: Alex Blasche Reviewed-by: Maurice Kalinowski --- src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index 7813bfdc..28d05ec1 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -436,6 +436,10 @@ HRESULT QWinRTBluetoothDeviceDiscoveryWorker::onBluetoothLEDeviceFound(ComPtr deviceInfo; hr = device2->get_DeviceInformation(&deviceInfo); Q_ASSERT_SUCCEEDED(hr); + if (!deviceInfo) { + qCDebug(QT_BT_WINRT) << "onBluetoothLEDeviceFound: Could not obtain device information"; + return S_OK; + } ComPtr deviceInfo2; hr = deviceInfo.As(&deviceInfo2); Q_ASSERT_SUCCEEDED(hr); -- cgit v1.2.3