Fix wifi SSID length to 33 since the maximum chars for SSID is 32 but the string is null terminated so array size must be 33
This commit is contained in:
parent
503e66a500
commit
608f56ebf4
4 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue