From 0e87e798b5840fe8b684e4782af50c8e02acac8b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 12 Jun 2014 18:38:31 +0300 Subject: [PATCH] Fix HS20_GET_NAI_HOME_REALM_LIST hex length check (CID 68108) Due to an incorrect operation (MOD vs. AND), the code that was supposed to return an error if the hex string has odd length was not really reporting any failures. Instead of reporting an error, the invalid control interface command would have been truncated. This is not an issue in practice, but better fix the implementation anyway. Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 53e23fff0..431120806 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -5368,7 +5368,7 @@ static int hs20_get_nai_home_realm_list(struct wpa_supplicant *wpa_s, if (len == 0 && cred && cred->realm) return hs20_nai_home_realm_list(wpa_s, dst_addr, cred->realm); - if (len % 1) + if (len & 1) return -1; len /= 2; buf = os_malloc(len);