From: Jouni Malinen Date: Thu, 17 Nov 2011 17:58:33 +0000 (+0200) Subject: WPS: Use strdup to initialize dev_password for PBC X-Git-Tag: aosp-jb-start~319 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68a0f6d768578e6f1ad81a1f80c247ad57861eae;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/wps/wps.c b/src/wps/wps.c index 9413ece0a..2ba3d4b4f 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; }