diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index d910b89e6482..76875dac9d69 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -2907,13 +2907,14 @@ static int orinoco_ioctl_setessid(struct net_device *dev, struct iw_point *erq) | |||
2907 | memset(&essidbuf, 0, sizeof(essidbuf)); | 2907 | memset(&essidbuf, 0, sizeof(essidbuf)); |
2908 | 2908 | ||
2909 | if (erq->flags) { | 2909 | if (erq->flags) { |
2910 | if (erq->length > IW_ESSID_MAX_SIZE) | 2910 | /* iwconfig includes the NUL in the specified length */ |
2911 | if (erq->length > IW_ESSID_MAX_SIZE+1) | ||
2911 | return -E2BIG; | 2912 | return -E2BIG; |
2912 | 2913 | ||
2913 | if (copy_from_user(&essidbuf, erq->pointer, erq->length)) | 2914 | if (copy_from_user(&essidbuf, erq->pointer, erq->length)) |
2914 | return -EFAULT; | 2915 | return -EFAULT; |
2915 | 2916 | ||
2916 | essidbuf[erq->length] = '\0'; | 2917 | essidbuf[IW_ESSID_MAX_SIZE] = '\0'; |
2917 | } | 2918 | } |
2918 | 2919 | ||
2919 | if (orinoco_lock(priv, &flags) != 0) | 2920 | if (orinoco_lock(priv, &flags) != 0) |