Преглед изворни кода

qcacld-3.0: Fix vlan_map array out of bound

Current code has the potential to access an
invalid array index of vlan_map.
Fix this by properly bounding the array.

Change-Id: I8f2eb220f2dfe822ca9486a5a2b66ddf186e6d4a
CRs-Fixed: 3562607
Mohammed Ahmed пре 1 година
родитељ
комит
2d54cacbd7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -22376,7 +22376,7 @@ wlan_hdd_add_vlan(struct wlan_objmgr_vdev *vdev, struct sap_context *sap_ctx,
 		return -EINVAL;
 	}
 
-	for (i = 0; i < (2 * MAX_VLAN); i += 2) {
+	for (i = 0; i < (MAX_VLAN - 1); i += 2) {
 		if (!vlan_map[i] || !vlan_map[i + 1]) {
 			found = 1;
 			break;