Skip to contentSkip to conversation

staging: vt6655: check too restrictive (off by one)

PATCH New Dan Carpenter 1 participant 1 message Jan 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6655: check too restrictive (off by one)

key_len = MAX_KEY_LEN is valid but we return an error.

Introduced-by 6b7200fe0a59 ('Staging: vt6655: memory corruption in check in wpa_set_wpadev()')
drivers/staging/vt6655/wpactl.c +2 -2
index ee83704e4401..d43efb85f4d3 100644
@@ -202,8 +202,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
 	int uu, ii;
 
 	if (param->u.wpa_key.alg_name > WPA_ALG_CCMP ||
-	    param->u.wpa_key.key_len >= MAX_KEY_LEN ||
-	    param->u.wpa_key.seq_len >= MAX_KEY_LEN)
+	    param->u.wpa_key.key_len > MAX_KEY_LEN ||
+	    param->u.wpa_key.seq_len > MAX_KEY_LEN)
 		return -EINVAL;
 
 	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "param->u.wpa_key.alg_name = %d \n", param->u.wpa_key.alg_name);