fix(wpa_supplicant): fix warnings found by GNU static analyzer

This commit is contained in:
Alexey Lapshin 2024-06-06 15:20:06 +07:00 committed by BOT
parent edbf6130db
commit f328e06ed4
2 changed files with 6 additions and 0 deletions

View File

@ -433,6 +433,8 @@ int ieee802_1x_init(struct hostapd_data *hapd)
os_memset(&conf, 0, sizeof(conf));
eap_cfg = os_zalloc(sizeof(struct eap_config));
if (!eap_cfg)
return -1;
eap_cfg->max_auth_rounds = 100;
eap_cfg->max_auth_rounds_short = 50;
//eap_cfg->backend_auth = 1;

View File

@ -202,6 +202,10 @@ static int ieee802_11_parse_vendor_specific(struct wpa_supplicant *wpa_s, const
case SAE_PK_OUI_TYPE:
wpa_s->sae_pk_elems.sae_pk_len = elem->datalen - 4;
wpa_s->sae_pk_elems.sae_pk = (u8*)os_zalloc(sizeof(u8)*(elem->datalen-4));
if (!wpa_s->sae_pk_elems.sae_pk) {
wpa_printf(MSG_EXCESSIVE, "Can not allocate memory for sae_pk");
return -1;
}
os_memcpy(wpa_s->sae_pk_elems.sae_pk, pos+4, elem->datalen-4);
break;
default: