aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/eapol_test.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-11 16:45:17 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-11 16:45:17 (GMT)
commite3a451118ecd555300e8ae242ef926ff4ad5cbcb (patch)
tree1d9c7c4fa908640cbaf9cc16dba628f3a70696fa /wpa_supplicant/eapol_test.c
parent7c0e5b58f998af8f018a227adec5cad5ff80bee3 (diff)
downloadhostap-e3a451118ecd555300e8ae242ef926ff4ad5cbcb.zip
hostap-e3a451118ecd555300e8ae242ef926ff4ad5cbcb.tar.gz
hostap-e3a451118ecd555300e8ae242ef926ff4ad5cbcb.tar.bz2
eapol_test: Check inet_aton() result
This makes code more consistent (CID 72676). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/eapol_test.c')
-rw-r--r--wpa_supplicant/eapol_test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index e19782f..e576c1a 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -928,7 +928,11 @@ static void wpa_init_conf(struct eapol_test_data *e,
*pos++ = a[3];
}
#else /* CONFIG_NATIVE_WINDOWS or CONFIG_ANSI_C_EXTRA */
- inet_aton(authsrv, &as->addr.u.v4);
+ if (inet_aton(authsrv, &as->addr.u.v4) < 0) {
+ wpa_printf(MSG_ERROR, "Invalid IP address '%s'",
+ authsrv);
+ assert(0);
+ }
#endif /* CONFIG_NATIVE_WINDOWS or CONFIG_ANSI_C_EXTRA */
as->addr.af = AF_INET;
as->port = port;