diff options
Diffstat (limited to 'net/wireless/wext.c')
-rw-r--r-- | net/wireless/wext.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index 5b4a0cee4418..60fe57761ca9 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -470,7 +470,7 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd) | |||
470 | /* | 470 | /* |
471 | * Get statistics out of the driver | 471 | * Get statistics out of the driver |
472 | */ | 472 | */ |
473 | static struct iw_statistics *get_wireless_stats(struct net_device *dev) | 473 | struct iw_statistics *get_wireless_stats(struct net_device *dev) |
474 | { | 474 | { |
475 | /* New location */ | 475 | /* New location */ |
476 | if ((dev->wireless_handlers != NULL) && | 476 | if ((dev->wireless_handlers != NULL) && |
@@ -773,10 +773,13 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, | |||
773 | essid_compat = 1; | 773 | essid_compat = 1; |
774 | else if (IW_IS_SET(cmd) && (iwp->length != 0)) { | 774 | else if (IW_IS_SET(cmd) && (iwp->length != 0)) { |
775 | char essid[IW_ESSID_MAX_SIZE + 1]; | 775 | char essid[IW_ESSID_MAX_SIZE + 1]; |
776 | unsigned int len; | ||
777 | len = iwp->length * descr->token_size; | ||
776 | 778 | ||
777 | err = copy_from_user(essid, iwp->pointer, | 779 | if (len > IW_ESSID_MAX_SIZE) |
778 | iwp->length * | 780 | return -EFAULT; |
779 | descr->token_size); | 781 | |
782 | err = copy_from_user(essid, iwp->pointer, len); | ||
780 | if (err) | 783 | if (err) |
781 | return -EFAULT; | 784 | return -EFAULT; |
782 | 785 | ||