taks / esp32-nimble

A wrapper for the ESP32 NimBLE Bluetooth stack.
Apache License 2.0
118 stars 35 forks source link

Crash when there are devices around with invalid utf8 names #43

Closed milewski closed 1 year ago

milewski commented 1 year ago

Hi, I have a neighbor with some random Chinese name device that crashes my APP whenever I try to scan with this lib

thread '<unnamed>' panicked at C:\Users\milewski\.cargo\registry\src\index.crates.io-6f17d22bba15001f\esp32-nimble-0.3.0\src\client\ble_advertised_device.rs:107:58:
called `Result::unwrap()` on an `Err` value: FromUtf8Error { bytes: [79, 84, 65, 0, 0, 0, 0, 0, 130, 0, 2, 0, 240, 110, 66, 117, 90, 90, 96], error: Utf8Error { valid_up_to: 8, error_len: Some(1) } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

image