mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
EAP-AKA: Use strdup instead of strlen + malloc + memcpy
While the copy is not used as a null terminated string, this can prevent some static analyzers from complaining about non-issue. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0ac6c3f71a
commit
363ab44067
@ -133,14 +133,13 @@ static void * eap_aka_prime_init(struct eap_sm *sm)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
data->eap_method = EAP_TYPE_AKA_PRIME;
|
data->eap_method = EAP_TYPE_AKA_PRIME;
|
||||||
data->network_name = os_malloc(os_strlen(network_name));
|
data->network_name = (u8 *) os_strdup(network_name);
|
||||||
if (data->network_name == NULL) {
|
if (data->network_name == NULL) {
|
||||||
os_free(data);
|
os_free(data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->network_name_len = os_strlen(network_name);
|
data->network_name_len = os_strlen(network_name);
|
||||||
os_memcpy(data->network_name, network_name, data->network_name_len);
|
|
||||||
|
|
||||||
data->state = IDENTITY;
|
data->state = IDENTITY;
|
||||||
eap_aka_determine_identity(sm, data, 1, 0);
|
eap_aka_determine_identity(sm, data, 1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user