Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WiFi SSID long 32 gets wrongly truncated by one #768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/include/sdk_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ struct sdk_g_ic_volatile_st {

struct sdk_g_ic_ssid_with_length {
uint32_t ssid_length; // 0x1e4 sdk_wpa_config_profile
uint8_t ssid[32]; // 0x1e8 Station ssid. Null terminated string.
uint8_t ssid[33]; // 0x1e8 Station ssid. Null terminated string.
};

// This is the portion of g_ic which is loaded/saved to the flash ROM, and thus
Expand Down
4 changes: 2 additions & 2 deletions extras/wificfg/wificfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ void wificfg_init(uint32_t port, const wificfg_dispatch *dispatch)
sysparam_get_string("hostname", &hostname);
if (!hostname && wificfg_default_hostname) {
uint8_t macaddr[6];
char name[32];
char name[33];
sdk_wifi_get_macaddr(1, macaddr);
snprintf(name, sizeof(name), wificfg_default_hostname, macaddr[3],
macaddr[4], macaddr[5]);
Expand Down Expand Up @@ -2108,7 +2108,7 @@ void wificfg_init(uint32_t port, const wificfg_dispatch *dispatch)
/* Default AP ssid and password. */
if (!wifi_ap_ssid && wificfg_default_ssid) {
uint8_t macaddr[6];
char ssid[32];
char ssid[33];
sdk_wifi_get_macaddr(1, macaddr);
snprintf(ssid, sizeof(ssid), wificfg_default_ssid, macaddr[3],
macaddr[4], macaddr[5]);
Expand Down
2 changes: 1 addition & 1 deletion include/espressif/esp_softap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#endif

struct sdk_softap_config {
uint8_t ssid[32];
uint8_t ssid[33];
uint8_t password[64];
uint8_t ssid_len;
uint8_t channel;
Expand Down
4 changes: 2 additions & 2 deletions include/espressif/esp_sta.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {
#endif

struct sdk_station_config {
uint8_t ssid[32]; /* Null terminated string */
uint8_t ssid[33]; /* Null terminated string */
uint8_t password[64]; /* Null terminated string */
uint8_t bssid_set; /* One if bssid is used, otherwise zero. */
uint8_t bssid[6]; /* The BSSID bytes */
Expand All @@ -38,7 +38,7 @@ struct sdk_bss_info {
STAILQ_ENTRY(sdk_bss_info) next;

uint8_t bssid[6];
uint8_t ssid[32];
uint8_t ssid[33];
uint8_t channel;
int8_t rssi;
AUTH_MODE authmode;
Expand Down