Re: [PATCH] Staging: rtl8723bs: rtw_wlan_util: Add size check of SSID IE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 21, 2020 at 08:08:06PM +0300, Denis Straghkov wrote:
>  	/* checking SSID */
> +	ssid_len = 0;
>  	p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
> -	if (!p) {
> -		DBG_871X("%s marc: cannot find SSID for survey event\n", __func__);
> -		hidden_ssid = true;
> -	} else {
> -		hidden_ssid = false;
> -	}
> -
> -	if ((NULL != p) && (false == hidden_ssid && (*(p + 1)))) {
> -		memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
> -		bssid->Ssid.SsidLength = *(p + 1);
> -	} else {
> -		bssid->Ssid.SsidLength = 0;
> -		bssid->Ssid.Ssid[0] = '\0';
> -	}
> +        if (p) {
> +                ssid_len = *(p + 1);
> +                if (ssid_len > NDIS_802_11_LENGTH_SSID)
> +                        ssid_len = 0;
> +        }
> +        memcpy(bssid->Ssid.Ssid, (p + 2), ssid_len);
> +        bssid->Ssid.SsidLength = ssid_len;

This is using spaces instead of tabs.  Please run ./scripts/checkpatch.pl
on your patch.

regargs,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux