From 9231c2476ff80f158826c10695a10e58a7fd3839 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 14 Mar 2016 18:42:46 +0200 Subject: [PATCH] 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 --- wlantest/bip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlantest/bip.c b/wlantest/bip.c index bda8036c5..c73a15c98 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;