mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
bluetooth: Fix crash in pa_bluetooth_discovery_get_device_by_address()
We need to check if the device information is valid first, so we don't pass invalid strings to pa_streq().
This commit is contained in:
parent
d8fb09b567
commit
b705e38a79
1 changed files with 2 additions and 2 deletions
|
|
@ -395,8 +395,8 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_device_by_address(pa_bluetooth_d
|
|||
pa_assert(local);
|
||||
|
||||
while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
|
||||
if (pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
|
||||
return d->device_info_valid == 1 ? d : NULL;
|
||||
if (d->device_info_valid == 1 && pa_streq(d->address, remote) && pa_streq(d->adapter->address, local))
|
||||
return d;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue