浏览代码

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 年之前
父节点
当前提交
538748570c
共有 1 个文件被更改,包括 2 次插入2 次删除
  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;
 	}