aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server/eap_server_aka.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-11-27 20:45:01 (GMT)
committerJouni Malinen <j@w1.fi>2011-11-27 20:45:01 (GMT)
commit363ab4406725260c308d8cccfab13e5989362e84 (patch)
tree8c2b30e3aa813f34623a96e7ab580e88debe8c2b /src/eap_server/eap_server_aka.c
parent0ac6c3f71a160964d1053288a3aa8fecfb488346 (diff)
downloadhostap-363ab4406725260c308d8cccfab13e5989362e84.zip
hostap-363ab4406725260c308d8cccfab13e5989362e84.tar.gz
hostap-363ab4406725260c308d8cccfab13e5989362e84.tar.bz2
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>
Diffstat (limited to 'src/eap_server/eap_server_aka.c')
-rw-r--r--src/eap_server/eap_server_aka.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/eap_server/eap_server_aka.c b/src/eap_server/eap_server_aka.c
index 42cbdce..0f25ffd 100644
--- a/src/eap_server/eap_server_aka.c
+++ b/src/eap_server/eap_server_aka.c
@@ -133,14 +133,13 @@ static void * eap_aka_prime_init(struct eap_sm *sm)
return NULL;
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) {
os_free(data);
return NULL;
}
data->network_name_len = os_strlen(network_name);
- os_memcpy(data->network_name, network_name, data->network_name_len);
data->state = IDENTITY;
eap_aka_determine_identity(sm, data, 1, 0);