Commit d0e3e87f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jeff Garzik

[PATCH] orinoco: fix setting of 32 character ESSIDs

Patch from Thomas Schulz

Index: linux-2.6/drivers/net/wireless/orinoco.c
===================================================================
parent b24d4582
...@@ -2907,13 +2907,14 @@ static int orinoco_ioctl_setessid(struct net_device *dev, struct iw_point *erq) ...@@ -2907,13 +2907,14 @@ static int orinoco_ioctl_setessid(struct net_device *dev, struct iw_point *erq)
memset(&essidbuf, 0, sizeof(essidbuf)); memset(&essidbuf, 0, sizeof(essidbuf));
if (erq->flags) { if (erq->flags) {
if (erq->length > IW_ESSID_MAX_SIZE) /* iwconfig includes the NUL in the specified length */
if (erq->length > IW_ESSID_MAX_SIZE+1)
return -E2BIG; return -E2BIG;
if (copy_from_user(&essidbuf, erq->pointer, erq->length)) if (copy_from_user(&essidbuf, erq->pointer, erq->length))
return -EFAULT; return -EFAULT;
essidbuf[erq->length] = '\0'; essidbuf[IW_ESSID_MAX_SIZE] = '\0';
} }
if (orinoco_lock(priv, &flags) != 0) if (orinoco_lock(priv, &flags) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment