Thanks to visit codestin.com
Credit goes to github.com

Skip to content

esp8266: bug in esp8266/modnetwork.c when connecting without password #3061

Closed
@Jostikas

Description

@Jostikas

In esp8266/modnetwork.c in function esp_connect isn't there a leak when an unsecure network is joined?

 if (n_args > 1) {
    p = mp_obj_str_get_data(args[1], &len);  # len gets a presumably nonzero value
    memcpy(config.ssid, p, len);
    if (n_args > 2) {
        p = mp_obj_str_get_data(args[2], &len);
    } else {
        p = "";   # len still has length of ssid
    }
    memcpy(config.password, p, len); # Doesn't this copy more than the empty string when unsecured network is joined?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions