whad-team / whad-client

Wireless Hacking Devices Protocol client
MIT License
101 stars 4 forks source link

Index out of range during "wble-central --interface ubertooth0; wble-central>scan" #43

Closed grymoire closed 1 week ago

grymoire commented 3 weeks ago

I installed via pip. While doing wble-central scan this error returned. `

File "/home/pi/Src/env/lib/python3.11/site-packages/whad/ble/profile/advdata.py", line 192, in from_bytes limited_disc = ((ad_record[0] & 0x01) != 0)


IndexError: index out of range
Segmentation fault
`
Full output attached 
[whad.txt](https://github.com/user-attachments/files/16651458/whad.txt)
virtualabs commented 3 weeks ago

It looks like a faulty advertisement record caused this error (flags record with no data). This failed because of the wrong check we made before parsing the record data.

virtualabs commented 3 weeks ago

Allright, I've fixed the bad check and added some unit tests to avoid any regression. You can test if this fix works by cloning the main branch and giving it a try, or you can just wait for a new release (coming soon).