aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/bip.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-03-14 16:42:46 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-14 16:42:46 (GMT)
commit9231c2476ff80f158826c10695a10e58a7fd3839 (patch)
tree965a7f4a3eb10ff780b069036ea65539698ce4f5 /wlantest/bip.c
parentc6c29be1bdc56bfd3a748f06063b1ba0aa80dc94 (diff)
downloadhostap-9231c2476ff80f158826c10695a10e58a7fd3839.zip
hostap-9231c2476ff80f158826c10695a10e58a7fd3839.tar.gz
hostap-9231c2476ff80f158826c10695a10e58a7fd3839.tar.bz2
wlantest: Fix bip_protect() memory allocation
The addition operator is of higher precedence than the ternary conditional and the construction here needs to use parentheses to calculate the buffer length properly when generating test frames with BIP protection. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wlantest/bip.c')
-rw-r--r--wlantest/bip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wlantest/bip.c b/wlantest/bip.c
index bda8036..c73a15c 100644
--- a/wlantest/bip.c
+++ b/wlantest/bip.c
@@ -23,7 +23,7 @@ u8 * bip_protect(const u8 *igtk, size_t igtk_len, u8 *frame, size_t len,
struct ieee80211_hdr *hdr;
size_t plen;
- plen = len + igtk_len == 32 ? 26 : 18;
+ plen = len + (igtk_len == 32 ? 26 : 18);
prot = os_malloc(plen);
if (prot == NULL)
return NULL;