wlan: validate essid length before processing scan req

Presently we are not validating the length of the essid received
and directly copying the buffer without size checking.
Perform bound checking before processing the scan req.

Change-Id: I786e4feb67bf039df3d217138a412da54f51787d
CRs-fixed: 890228
Bug: 27773913
This commit is contained in:
Arun Khandavalli 2016-04-11 12:42:58 -07:00 committed by Min Chong
parent 1683ab87bd
commit 19676e8954

View file

@ -685,7 +685,8 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
if(scanReq->essid_len) {
if(scanReq->essid_len &&
(scanReq->essid_len <= SIR_MAC_MAX_SSID_LENGTH)) {
scanRequest.SSIDs.numOfSSIDs = 1;
scanRequest.SSIDs.SSIDList =( tCsrSSIDInfo *)vos_mem_malloc(sizeof(tCsrSSIDInfo));
if(scanRequest.SSIDs.SSIDList) {
@ -699,6 +700,10 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
VOS_ASSERT(0);
}
}
else
{
hddLog(LOGE, FL("Invalid essid length : %d"), scanReq->essid_len);
}
}
/* set min and max channel time */