Browse Source

qcacld-3.0: Fix null ptr dereference in hdd_parse_vendor_acs_chan_config

Currently, hdd_parse_vendor_acs_chan_config does not do null validation for
tb[SET_CHAN_CHAN_LIST] which can lead to null pointer derefrence.

Add null pointer check for tb[SET_CHAN_CHAN_LIST] in
hdd_parse_vendor_acs_chan_config.

Change-Id: I8914e38a5d98536a816c80d484dec9878753966a
CRs-Fixed: 2410809
sheenam monga 6 năm trước cách đây
mục cha
commit
5440bddb4a
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 5 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -10018,6 +10018,11 @@ static int hdd_parse_vendor_acs_chan_config(struct hdd_vendor_chan_info
 	if (tb[SET_CHAN_REASON])
 		*reason = nla_get_u8(tb[SET_CHAN_REASON]);
 
+	if (!tb[SET_CHAN_CHAN_LIST]) {
+		hdd_err("channel list empty");
+		return -EINVAL;
+	}
+
 	nla_for_each_nested(curr_attr, tb[SET_CHAN_CHAN_LIST], rem)
 		i++;