Skip to content

Commit 6c1b134

Browse files
committed
esp8266/modnetwork.c: esp_connect() avoid potential buffer overflows
1 parent ee26807 commit 6c1b134

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

esp8266/modnetwork.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ STATIC mp_obj_t esp_connect(mp_uint_t n_args, const mp_obj_t *args) {
102102

103103
if (n_args > 1) {
104104
p = mp_obj_str_get_data(args[1], &len);
105+
len = MIN(len, sizeof(config.ssid));
105106
memcpy(config.ssid, p, len);
106107
if (n_args > 2) {
107108
p = mp_obj_str_get_data(args[2], &len);
109+
len = MIN(len, sizeof(config.password));
108110
memcpy(config.password, p, len);
109111
}
110112

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy