Browse Source

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 <j@w1.fi>
Jouni Malinen 10 years ago
parent
commit
0e87e798b5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wpa_supplicant/ctrl_iface.c

+ 1 - 1
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);