Discussion:
[patch] Staging: otus: fix strcpy() overflow
Dan Carpenter
2010-06-07 21:18:50 UTC
Permalink
wrq->name is only 16 characters long but "IEEE 802.11-MIMO" is 16
characters + a NULL character, so it's too long. I changed the name to
just "802.11-MIMO".

Signed-off-by: Dan Carpenter <***@gmail.com>

diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
index a48c8e4..3887932 100644
--- a/drivers/staging/otus/ioctl.c
+++ b/drivers/staging/otus/ioctl.c
@@ -507,7 +507,7 @@ int usbdrvwext_giwname(struct net_device *dev,
{
/* struct usbdrv_private *macp = dev->ml_priv; */

- strcpy(wrq->name, "IEEE 802.11-MIMO");
+ strcpy(wrq->name, "802.11-MIMO");

return 0;
}
Luis R. Rodriguez
2010-06-07 21:25:05 UTC
Permalink
Post by Dan Carpenter
wrq->name is only 16 characters long but "IEEE 802.11-MIMO" is 16
characters + a NULL character, so it's too long. I changed the name to
just "802.11-MIMO".
diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
index a48c8e4..3887932 100644
--- a/drivers/staging/otus/ioctl.c
+++ b/drivers/staging/otus/ioctl.c
@@ -507,7 +507,7 @@ int usbdrvwext_giwname(struct net_device *dev,
{
/* struct usbdrv_private *macp = dev->ml_priv; */
- strcpy(wrq->name, "IEEE 802.11-MIMO");
+ strcpy(wrq->name, "802.11-MIMO");
Nack, use instead:

IEEE 802.11abgn

Luis
Dan Carpenter
2010-06-07 21:44:57 UTC
Permalink
wrq->name is only 16 characters long but "IEEE 802.11-MIMO" is 16
characters + a NULL character, so it's too long. This patch changes it
to "IEEE 802.11abgn".

Signed-off-by: Dan Carpenter <***@gmail.com>
---
V2: Luis R. Rodriguez suggested that "IEEE 802.11abgn" was the correct
name to use.

diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
index a48c8e4..b85f1b2 100644
--- a/drivers/staging/otus/ioctl.c
+++ b/drivers/staging/otus/ioctl.c
@@ -507,7 +507,7 @@ int usbdrvwext_giwname(struct net_device *dev,
{
/* struct usbdrv_private *macp = dev->ml_priv; */

- strcpy(wrq->name, "IEEE 802.11-MIMO");
+ strcpy(wrq->name, "IEEE 802.11abgn");

return 0;
}

Loading...