diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-02-27 01:54:48 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-02-27 01:54:48 +0100 |
commit | fe1d292f241bc7a024a9c20627f6300f3ebc433b (patch) | |
tree | a1f4a121c66da4961ae0afe8ff29ae37af2d40cc /fw/esp32 | |
parent | 9d91377659c1ffc0f23373dc0b2ff4edaafac6a8 (diff) |
wifi scan verifies length of ssid
Diffstat (limited to 'fw/esp32')
-rwxr-xr-x | fw/esp32/components/eos/wifi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fw/esp32/components/eos/wifi.c b/fw/esp32/components/eos/wifi.c index a20e076..7fae635 100755 --- a/fw/esp32/components/eos/wifi.c +++ b/fw/esp32/components/eos/wifi.c @@ -73,7 +73,8 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t e rbuf[0] = EOS_WIFI_MTYPE_SCAN; p = rbuf + 1; for (i=0; i<scan_n; i++) { - len = strlen((char *)scan_r[i].ssid); + len = strnlen((char *)scan_r[i].ssid, 33); + if (len > 32) continue; if (p - rbuf + len + 1 > EOS_NET_SIZE_BUF) break; strcpy((char *)p, (char *)scan_r[i].ssid); p += len + 1; |