| .. | .. |
|---|
| 1059 | 1059 | _rtw_memcpy(padapter->securitypriv.supplicant_ie, &buf[0], ielen); |
|---|
| 1060 | 1060 | } |
|---|
| 1061 | 1061 | |
|---|
| 1062 | | - if (rtw_parse_wpa2_ie(buf, ielen, &group_cipher, &pairwise_cipher, NULL, NULL, &mfp_opt, NULL) == _SUCCESS) { |
|---|
| 1062 | + if (rtw_parse_wpa2_ie(buf, ielen, &group_cipher, &pairwise_cipher, NULL, NULL, &mfp_opt) == _SUCCESS) { |
|---|
| 1063 | 1063 | padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; |
|---|
| 1064 | 1064 | padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK; |
|---|
| 1065 | 1065 | _rtw_memcpy(padapter->securitypriv.supplicant_ie, &buf[0], ielen); |
|---|
| .. | .. |
|---|
| 4319 | 4319 | |
|---|
| 4320 | 4320 | wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]); |
|---|
| 4321 | 4321 | if (wpsie) { |
|---|
| 4322 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 4323 | 4322 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *)&attr_content, &attr_contentlen); |
|---|
| 4324 | 4323 | if (attr_contentlen) { |
|---|
| 4325 | 4324 | attr_content = be16_to_cpu(attr_content); |
|---|
| .. | .. |
|---|
| 4453 | 4452 | /* The P2P Device Info attribute is included in the probe response frame. */ |
|---|
| 4454 | 4453 | |
|---|
| 4455 | 4454 | _rtw_memset(attr_content, 0x00, 100); |
|---|
| 4456 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 4457 | 4455 | if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { |
|---|
| 4458 | 4456 | /* Handle the P2P Device ID attribute of Beacon first */ |
|---|
| 4459 | 4457 | blnMatch = 1; |
|---|
| .. | .. |
|---|
| 4536 | 4534 | |
|---|
| 4537 | 4535 | wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]); |
|---|
| 4538 | 4536 | if (wpsie) { |
|---|
| 4539 | | - dev_type_len = sizeof(dev_type); |
|---|
| 4540 | 4537 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len); |
|---|
| 4541 | 4538 | if (dev_type_len) { |
|---|
| 4542 | 4539 | u16 type = 0; |
|---|
| .. | .. |
|---|
| 4611 | 4608 | |
|---|
| 4612 | 4609 | wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]); |
|---|
| 4613 | 4610 | if (wpsie) { |
|---|
| 4614 | | - dev_len = sizeof(dev_name); |
|---|
| 4615 | 4611 | rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len); |
|---|
| 4616 | 4612 | if (dev_len) { |
|---|
| 4617 | 4613 | sprintf(dev_name_str, "\n\nN=%s", dev_name); |
|---|
| .. | .. |
|---|
| 4652 | 4648 | struct wlan_network *pnetwork = NULL; |
|---|
| 4653 | 4649 | u8 blnMatch = 0; |
|---|
| 4654 | 4650 | u8 *p2pie; |
|---|
| 4655 | | - uint p2pielen = 0, attr_contentlen = 2; |
|---|
| 4651 | + uint p2pielen = 0, attr_contentlen = 0; |
|---|
| 4656 | 4652 | u8 attr_content[2] = { 0x00 }; |
|---|
| 4657 | 4653 | u8 inv_proc_str[P2P_PRIVATE_IOCTL_SET_LEN] = { 0x00 }; |
|---|
| 4658 | 4654 | |
|---|
| .. | .. |
|---|
| 4683 | 4679 | if (p2pie) { |
|---|
| 4684 | 4680 | while (p2pie) { |
|---|
| 4685 | 4681 | /* _rtw_memset( attr_content, 0x00, 2); */ |
|---|
| 4686 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 4687 | 4682 | if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_CAPABILITY, attr_content, &attr_contentlen)) { |
|---|
| 4688 | 4683 | /* Handle the P2P capability attribute */ |
|---|
| 4689 | 4684 | blnMatch = 1; |
|---|
| .. | .. |
|---|
| 4856 | 4851 | uint uintPeerChannel = 0; |
|---|
| 4857 | 4852 | u8 attr_content[50] = { 0x00 }; |
|---|
| 4858 | 4853 | u8 *p2pie; |
|---|
| 4859 | | - uint p2pielen = 0, attr_contentlen = 50; |
|---|
| 4854 | + uint p2pielen = 0, attr_contentlen = 0; |
|---|
| 4860 | 4855 | _irqL irqL; |
|---|
| 4861 | 4856 | struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info; |
|---|
| 4862 | 4857 | #ifdef CONFIG_CONCURRENT_MODE |
|---|
| .. | .. |
|---|
| 4914 | 4909 | /* The P2P Device ID attribute is included in the Beacon frame. */ |
|---|
| 4915 | 4910 | /* The P2P Device Info attribute is included in the probe response frame. */ |
|---|
| 4916 | 4911 | |
|---|
| 4917 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 4918 | 4912 | if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { |
|---|
| 4919 | 4913 | /* Handle the P2P Device ID attribute of Beacon first */ |
|---|
| 4920 | 4914 | if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) { |
|---|
| .. | .. |
|---|
| 5130 | 5124 | struct wlan_network *pnetwork = NULL; |
|---|
| 5131 | 5125 | u8 attr_content[50] = { 0x00 }; |
|---|
| 5132 | 5126 | u8 *p2pie; |
|---|
| 5133 | | - uint p2pielen = 0, attr_contentlen = 50; |
|---|
| 5127 | + uint p2pielen = 0, attr_contentlen = 0; |
|---|
| 5134 | 5128 | _irqL irqL; |
|---|
| 5135 | 5129 | uint uintPeerChannel = 0; |
|---|
| 5136 | 5130 | |
|---|
| .. | .. |
|---|
| 5170 | 5164 | /* The P2P Device ID attribute is included in the Beacon frame. */ |
|---|
| 5171 | 5165 | /* The P2P Device Info attribute is included in the probe response frame. */ |
|---|
| 5172 | 5166 | printk("[%s] Got P2P IE\n", __FUNCTION__); |
|---|
| 5173 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 5174 | 5167 | if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { |
|---|
| 5175 | 5168 | /* Handle the P2P Device ID attribute of Beacon first */ |
|---|
| 5176 | 5169 | printk("[%s] P2P_ATTR_DEVICE_ID\n", __FUNCTION__); |
|---|
| .. | .. |
|---|
| 5343 | 5336 | uint uintPeerChannel = 0; |
|---|
| 5344 | 5337 | u8 attr_content[100] = { 0x00 }; |
|---|
| 5345 | 5338 | u8 *p2pie; |
|---|
| 5346 | | - uint p2pielen = 0, attr_contentlen = 100; |
|---|
| 5339 | + uint p2pielen = 0, attr_contentlen = 0; |
|---|
| 5347 | 5340 | _irqL irqL; |
|---|
| 5348 | 5341 | #ifdef CONFIG_CONCURRENT_MODE |
|---|
| 5349 | 5342 | struct roch_info *prochinfo = &padapter->rochinfo; |
|---|
| .. | .. |
|---|
| 5412 | 5405 | while (p2pie) { |
|---|
| 5413 | 5406 | /* The P2P Device ID attribute is included in the Beacon frame. */ |
|---|
| 5414 | 5407 | /* The P2P Device Info attribute is included in the probe response frame. */ |
|---|
| 5415 | | - attr_contentlen = sizeof(attr_content); |
|---|
| 5408 | + |
|---|
| 5416 | 5409 | if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { |
|---|
| 5417 | 5410 | /* Handle the P2P Device ID attribute of Beacon first */ |
|---|
| 5418 | 5411 | if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { |
|---|
| .. | .. |
|---|
| 12893 | 12886 | extra = buffer; |
|---|
| 12894 | 12887 | |
|---|
| 12895 | 12888 | handler = priv[priv_args[k].cmd - SIOCIWFIRSTPRIV]; |
|---|
| 12889 | + if (handler == NULL) { |
|---|
| 12890 | + err = -EINVAL; |
|---|
| 12891 | + goto exit; |
|---|
| 12892 | + } |
|---|
| 12893 | + |
|---|
| 12896 | 12894 | err = handler(dev, NULL, &wdata, extra); |
|---|
| 12897 | 12895 | |
|---|
| 12898 | 12896 | /* If we have to get some data */ |
|---|