mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
wapi: Fix disconnect crash.
The ssid string has no terminator, which causes a out of bounds. Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
parent
4576b3923c
commit
5ae44f9bc4
1 changed files with 3 additions and 1 deletions
|
|
@ -429,7 +429,7 @@ int wpa_driver_wext_get_auth_param(int sockfd, FAR const char *ifname,
|
|||
|
||||
void wpa_driver_wext_disconnect(int sockfd, FAR const char *ifname)
|
||||
{
|
||||
uint8_t ssid[WAPI_ESSID_MAX_SIZE];
|
||||
uint8_t ssid[WAPI_ESSID_MAX_SIZE + 1];
|
||||
const struct ether_addr bssid =
|
||||
{
|
||||
};
|
||||
|
|
@ -471,6 +471,8 @@ void wpa_driver_wext_disconnect(int sockfd, FAR const char *ifname)
|
|||
ssid[i] = rand() & 0xff;
|
||||
}
|
||||
|
||||
ssid[WAPI_ESSID_MAX_SIZE] = '\0';
|
||||
|
||||
if (wapi_set_essid(sockfd, ifname,
|
||||
(FAR const char *)ssid, WAPI_ESSID_OFF) < 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue