]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
common: Fix ieee802_11_rsnx_capab()
authorDaniel Gabay <daniel.gabay@intel.com>
Thu, 2 Nov 2023 13:21:52 +0000 (15:21 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 2 Nov 2023 14:09:08 +0000 (16:09 +0200)
The function should return bool (0/1) and not int. In some environments
bool may be defined as unsigned char, so bits higher then 7 will be
discarded during the downcast. Fix it.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/common/ieee802_11_common.c

index 21c3ed701024656f57d8c57998499f7ce70335b0..093339cb4392b13d144a4a05e9c81810ad2ded58 100644 (file)
@@ -2962,7 +2962,7 @@ bool ieee802_11_rsnx_capab_len(const u8 *rsnxe, size_t rsnxe_len,
        for (i = 0; i < flen; i++)
                capabs |= rsnxe[i] << (8 * i);
 
-       return capabs & BIT(capab);
+       return !!(capabs & BIT(capab));
 }