]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix HS20_GET_NAI_HOME_REALM_LIST hex length check (CID 68108)
authorJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 15:38:31 +0000 (18:38 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 16:45:27 +0000 (19:45 +0300)
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>
wpa_supplicant/ctrl_iface.c

index 53e23fff06a79e44e00cb9daeb1ad70e8e89197f..4311208061a2fd39e8e5fc1394e0c08ae103be07 100644 (file)
@@ -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);