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

Undefined behavior in wpa3_process_rx_commit function (IDFGH-14308) #15099

Open
3 tasks done
safocl opened this issue Dec 26, 2024 · 1 comment
Open
3 tasks done

Undefined behavior in wpa3_process_rx_commit function (IDFGH-14308) #15099

safocl opened this issue Dec 26, 2024 · 1 comment
Assignees
Labels
Status: Opened Issue is new

Comments

@safocl
Copy link

safocl commented Dec 26, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

if (esp_send_sae_auth_reply(hapd, frm->bssid, frm->bssid, WLAN_AUTH_SAE,
produce undefined behavior:
esp_send_sae_auth_reply(hapd, frm->bssid, frm->bssid, WLAN_AUTH_SAE, frm->auth_transaction, ret, NULL, 0);
NULL passed to ies argument of esp_send_sae_auth_reply function:

int esp_send_sae_auth_reply(struct hostapd_data *hapd,
                            const u8 *dst, const u8 *bssid,
                            u16 auth_alg, u16 auth_transaction, u16 resp,
                            const u8 *ies, size_t ies_len)

int esp_send_sae_auth_reply(struct hostapd_data *hapd,
->
it passed to second argument of memcpy
os_memcpy(&((uint16_t *)req->data)[3], ies, ies_len - 3 * sizeof(uint16_t));
and The behavior is undefined if either dest or src is an invalid or null pointer. for this function (https://en.cppreference.com/w/c/string/byte/memcpy).

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 26, 2024
@github-actions github-actions bot changed the title Undefined behavior in wpa3_process_rx_commit function Undefined behavior in wpa3_process_rx_commit function (IDFGH-14308) Dec 26, 2024
@safocl
Copy link
Author

safocl commented Dec 27, 2024

maybe need replace NULL to (u8 *) "" ?
how it's done in

data ? wpabuf_head(data) : (u8 *) "",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants