>From b755c8ee282abbd0008e9e7241c457662c90f2c3 Mon Sep 17 00:00:00 2001 From: Amit Khatri <amit.khatri@xxxxxxxxxxx> Date: Thu, 2 Nov 2017 15:55:16 +0530 Subject: [PATCH] IW: Zero or Uninitialized value of keylen passing In case of hexadeciaml keydata, keylen is not gettig updated and passing in NLA_PUT(msg, NL80211_KEY_DATA, keylen, keydata) as zero (becasue of local variable). This patch initilalize keylen variable in case of hexkey data. Signed-off-by: Amit Khatri <amit.khatri@xxxxxxxxxxx> --- util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.c b/util.c index 25d909a..1ec0791 100644 --- a/util.c +++ b/util.c @@ -427,12 +427,14 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc) switch (strlen(keydata)) { case 10: keydata = hex2bin(keydata, keybuf); + keylen = 5; case 5: NLA_PUT_U32(msg, NL80211_KEY_CIPHER, 0x000FAC01); keylen = 5; break; case 26: keydata = hex2bin(keydata, keybuf); + keylen = 13; case 13: NLA_PUT_U32(msg, NL80211_KEY_CIPHER, 0x000FAC05); keylen = 13; -- 2.7.4