Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 518ff04f authored by John W. Linville's avatar John W. Linville
Browse files

orinoco: correct key bounds check in orinoco_hw_get_tkip_iv



If key is 4 that is an array out of bounds.

Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 523d2f69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc)
	int err = 0;
	u8 tsc_arr[4][IW_ENCODE_SEQ_MAX_SIZE];

	if ((key < 0) || (key > 4))
	if ((key < 0) || (key >= 4))
		return -EINVAL;

	err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV,