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>
This commit is contained in:
parent
c6c29be1bd
commit
9231c2476f
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ u8 * bip_protect(const u8 *igtk, size_t igtk_len, u8 *frame, size_t len,
|
||||||
struct ieee80211_hdr *hdr;
|
struct ieee80211_hdr *hdr;
|
||||||
size_t plen;
|
size_t plen;
|
||||||
|
|
||||||
plen = len + igtk_len == 32 ? 26 : 18;
|
plen = len + (igtk_len == 32 ? 26 : 18);
|
||||||
prot = os_malloc(plen);
|
prot = os_malloc(plen);
|
||||||
if (prot == NULL)
|
if (prot == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue