diff mbox

Hostap: copying wrong data prism2_ioctl_giwaplist()

Message ID 20130809095231.GD29282@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Aug. 9, 2013, 9:52 a.m. UTC
We want the data stored in "addr" and "qual", but the extra ampersands
mean we are copying stack data instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff.  Untested.  Should probably be applied to -stable
as well.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

John W. Linville Aug. 9, 2013, 3:34 p.m. UTC | #1
Here I must insert the obligatory question:

	Does anyone actually still use the hostap driver??

John

On Fri, Aug 09, 2013 at 12:52:31PM +0300, Dan Carpenter wrote:
> We want the data stored in "addr" and "qual", but the extra ampersands
> mean we are copying stack data instead.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Untested.  Should probably be applied to -stable
> as well.
> 
> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
> index ac07473..e509030 100644
> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
> @@ -523,9 +523,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
>  
>  	data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
>  
> -	memcpy(extra, &addr, sizeof(struct sockaddr) * data->length);
> +	memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
>  	data->flags = 1; /* has quality information */
> -	memcpy(extra + sizeof(struct sockaddr) * data->length, &qual,
> +	memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
>  	       sizeof(struct iw_quality) * data->length);
>  
>  	kfree(addr);
>
diff mbox

Patch

diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index ac07473..e509030 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -523,9 +523,9 @@  static int prism2_ioctl_giwaplist(struct net_device *dev,
 
 	data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
 
-	memcpy(extra, &addr, sizeof(struct sockaddr) * data->length);
+	memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
 	data->flags = 1; /* has quality information */
-	memcpy(extra + sizeof(struct sockaddr) * data->length, &qual,
+	memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
 	       sizeof(struct iw_quality) * data->length);
 
 	kfree(addr);