aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/linux_ioctl.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-16 15:19:06 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-16 15:19:06 (GMT)
commitde1b2d143a561292e87c0b806fe508559c408f24 (patch)
treea0543c17dede9ff9e4e7c353d3992bde8aeb5035 /src/drivers/linux_ioctl.c
parent7899e2f42d91336393ec464fc85b57bd9e1cf1d5 (diff)
downloadhostap-de1b2d143a561292e87c0b806fe508559c408f24.zip
hostap-de1b2d143a561292e87c0b806fe508559c408f24.tar.gz
hostap-de1b2d143a561292e87c0b806fe508559c408f24.tar.bz2
Make sure the resutl from readlink is properly null terminated
Diffstat (limited to 'src/drivers/linux_ioctl.c')
-rw-r--r--src/drivers/linux_ioctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/linux_ioctl.c b/src/drivers/linux_ioctl.c
index f806167..0d6cf54 100644
--- a/src/drivers/linux_ioctl.c
+++ b/src/drivers/linux_ioctl.c
@@ -186,7 +186,8 @@ int linux_br_get(char *brname, const char *ifname)
char path[128], brlink[128], *pos;
os_snprintf(path, sizeof(path), "/sys/class/net/%s/brport/bridge",
ifname);
- if (readlink(path, brlink, sizeof(brlink)) < 0)
+ os_memset(brlink, 0, sizeof(brlink));
+ if (readlink(path, brlink, sizeof(brlink) - 1) < 0)
return -1;
pos = os_strrchr(brlink, '/');
if (pos == NULL)