aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-11-17 19:58:33 +0200
committerJouni Malinen <j@w1.fi>2011-11-17 19:58:33 +0200
commit68a0f6d768578e6f1ad81a1f80c247ad57861eae (patch)
treec884d7a0b5874612b3225e7f7b28465e991632ac /src/wps
parentbfbc4284a8fe0307c29336b5ed252163d8f0892d (diff)
downloadexternal_wpa_supplicant_8_ti-68a0f6d768578e6f1ad81a1f80c247ad57861eae.zip
external_wpa_supplicant_8_ti-68a0f6d768578e6f1ad81a1f80c247ad57861eae.tar.gz
external_wpa_supplicant_8_ti-68a0f6d768578e6f1ad81a1f80c247ad57861eae.tar.bz2
WPS: Use strdup to initialize dev_password for PBC
Some static analyzers complain about memset with '0' value. This was used correctly here, but since use of strdup is about as good an option, use that to silence the invalid warnings. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 9413ece..2ba3d4b 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -67,12 +67,11 @@ struct wps_data * wps_init(const struct wps_config *cfg)
/* Use special PIN '00000000' for PBC */
data->dev_pw_id = DEV_PW_PUSHBUTTON;
os_free(data->dev_password);
- data->dev_password = os_malloc(8);
+ data->dev_password = (u8 *) os_strdup("00000000");
if (data->dev_password == NULL) {
os_free(data);
return NULL;
}
- os_memset(data->dev_password, '0', 8);
data->dev_password_len = 8;
}