From: Jouni Malinen Date: Thu, 12 Jun 2014 15:38:31 +0000 (+0300) Subject: Fix HS20_GET_NAI_HOME_REALM_LIST hex length check (CID 68108) X-Git-Tag: hostap_2_3~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e87e798b5840fe8b684e4782af50c8e02acac8b;p=thirdparty%2Fhostap.git 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 --- 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);