mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(wifi): zero-init pub_id and sub_id in NAN service functions
Both variables were declared as int but only their LSB was written by the internal allocation function, leaving upper bytes as stack garbage. Logging with %u then printed large bogus values. Closes https://github.com/espressif/esp-idf/issues/18314
This commit is contained in:
@@ -892,7 +892,7 @@ esp_err_t esp_wifi_nan_sync_stop(void)
|
||||
|
||||
uint8_t esp_wifi_nan_publish_service(const wifi_nan_publish_cfg_t *publish_cfg)
|
||||
{
|
||||
int pub_id;
|
||||
int pub_id = 0;
|
||||
|
||||
if (publish_cfg->usd_discovery_flag && !s_usd_in_progress) {
|
||||
ESP_LOGE(TAG, "Can not start Publish function with USD Discovery "
|
||||
@@ -977,7 +977,7 @@ fail:
|
||||
|
||||
uint8_t esp_wifi_nan_subscribe_service(const wifi_nan_subscribe_cfg_t *subscribe_cfg)
|
||||
{
|
||||
int sub_id;
|
||||
int sub_id = 0;
|
||||
|
||||
if (subscribe_cfg->usd_discovery_flag && !s_usd_in_progress) {
|
||||
ESP_LOGE(TAG, "Can not start Subscribe function with USD Discovery "
|
||||
|
||||
Reference in New Issue
Block a user