Unverified Commit 46dd005d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10610 wifi: cfg80211: wext: add extra SIOCSIWSCAN data check

parents 0238c008 18e61046
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3163,10 +3163,14 @@ int cfg80211_wext_siwscan(struct net_device *dev,
	wiphy = &rdev->wiphy;

	/* Determine number of channels, needed to allocate creq */
	if (wreq && wreq->num_channels)
	if (wreq && wreq->num_channels) {
		/* Passed from userspace so should be checked */
		if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES))
			return -EINVAL;
		n_channels = wreq->num_channels;
	else
	} else {
		n_channels = ieee80211_get_num_supported_channels(wiphy);
	}

	creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) +
		       n_channels * sizeof(void *),