Kaynağa Gözat

qcacld-3.0: Validate length argument's lower boundary

While processing set key vendor command, lower boundary of key
length isn't validated properly, which might lead to buffer overflow.

Validate lower boundary of key length argument properly before
processing set key vendor command.

Change-Id: Ic7a6367db507e652a39a82c6489d64937f1b3429
CRs-Fixed: 2200948
Hanumanth Reddy Pothula 7 yıl önce
ebeveyn
işleme
538748570c
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      core/hdd/src/wlan_hdd_cfg80211.c

+ 2 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5653,8 +5653,8 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if ((data == NULL) || (data_len == 0) ||
-			(data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
+	if ((data == NULL) || (data_len <= 0) ||
+	    (data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
 		hdd_err("Invalid data");
 		return -EINVAL;
 	}