diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2017-01-18 15:25:14 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2017-01-19 12:19:08 +0000 |
commit | 09b287e98fab38f9c6e9e76e185d5662d9a14a6c (patch) | |
tree | af31b122825021ba98306350b6130f13ac0ff8b5 /src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | |
parent | d977db44ed57fd74562f049e70f336800ff9d585 (diff) |
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 <alexander.blasche@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<IB ComPtr<IDeviceInformation> 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<IDeviceInformation2> deviceInfo2; hr = deviceInfo.As(&deviceInfo2); Q_ASSERT_SUCCEEDED(hr); |