summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
diff options
context:
space:
mode:
authorAlan <gnomes@lxorguk.ukuu.org.uk>2016-02-15 18:58:10 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-05 14:48:04 -0800
commit0c68423556b59d1ebd65b056e7f24ab7089da401 (patch)
tree30e9e664a043455be64676ebbe215ea0f5015b30 /drivers/staging/rtl8712/rtl871x_ioctl_linux.c
parentd6e29ca1f6cf566f67012dce269b5f9ba72a1659 (diff)
downloadop-kernel-dev-0c68423556b59d1ebd65b056e7f24ab7089da401.zip
op-kernel-dev-0c68423556b59d1ebd65b056e7f24ab7089da401.tar.gz
rtl871x: avoid running off end of buffer
If 32 bytes of non zero are passed in pdata->pointer then the mac_pton function will run off the end of the buffer. Make sure we always have a terminated string kernel side. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_ioctl_linux.c')
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_linux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index a15f3ce..1b9e249 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1961,7 +1961,7 @@ static int r871x_get_ap_info(struct net_device *dev,
struct list_head *plist, *phead;
unsigned char *pbuf;
u8 bssid[ETH_ALEN];
- char data[32];
+ char data[33];
if (padapter->bDriverStopped || (pdata == NULL))
return -EINVAL;
@@ -1976,6 +1976,7 @@ static int r871x_get_ap_info(struct net_device *dev,
if (pdata->length >= 32) {
if (copy_from_user(data, pdata->pointer, 32))
return -EINVAL;
+ data[32] = 0;
} else {
return -EINVAL;
}
OpenPOWER on IntegriCloud